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
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
modesimilar 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