Add option to set request mode for fetch API
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
Research direction
Start in src/util/ajax.ts around line 118 and compare the existing request options with the Fetch RequestInit mode documentation linked in the issue. Done means callers can provide a request mode and same-origin-only requests can prevent cross-origin fetches; verify the behavior with the project's relevant checks.
Written by the indexing model from the issue text.
Description
Motivation
It is not strictly necessary in most cases, but if I know I only use URLs from the same-origin it can be better to use mode: 'same-security' for fetch requests to block cross origin requests altogether.
It isn't strictly necessary but it could be used to avoid accidentally calling CORS URLs
Implementation
In https://github.com/mapbox/mapbox-gl-js/blob/v3.24.0/src/util/ajax.ts#L118 add an option to also provide mode similar to cache mode etc.
See also https://developer.mozilla.org/en-US/docs/Web/API/Request/mode and https://developer.mozilla.org/en-US/docs/Web/API/RequestInit#mode
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/mapbox-gl-js
-
auto-triaged bug :lady_beetle:
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
mapbox/mapbox-gl-js#13723 ·
-
auto-triaged bug :lady_beetle:
Difficulty 1/5 Under an hour Newbie friendliness 86/100
mapbox/mapbox-gl-js#13717 ·
-
auto-triaged bug :lady_beetle:
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
mapbox/mapbox-gl-js#13714 ·
-
auto-triaged bug :lady_beetle:
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mapbox/mapbox-gl-js#13639 · 1 reaction ·
-
docs :scroll:
Difficulty 1/5 Under an hour Newbie friendliness 68/100
mapbox/mapbox-gl-js#13523 ·
All issues in mapbox/mapbox-gl-js
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100