Skip to content

Commit

Permalink
fix: use no-cors mode when requesting images
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbllmnn committed Dec 6, 2022
1 parent de050b7 commit 3c0e9c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/parser/SHOGunApplicationUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ class SHOGunApplicationUtil<T extends Application, S extends Layer> {

let capabilities;
try {
const capabilitiesResponse = await fetch(capabilitiesUrl);
const capabilitiesResponse = await fetch(capabilitiesUrl, {
mode: 'no-cors'
});
const capabilitiesResponseText = await capabilitiesResponse.text();

capabilities = wmtsCapabilitiesParser.read(capabilitiesResponseText);
Expand Down Expand Up @@ -595,6 +597,7 @@ class SHOGunApplicationUtil<T extends Application, S extends Layer> {
URL.revokeObjectURL(this.objectUrls[src]);
}
const response = await fetch(src, {
mode: 'no-cors',
headers: useBearerToken ? {
...getBearerTokenHeader(this.client?.getKeycloak())
} : {}
Expand Down

0 comments on commit 3c0e9c8

Please sign in to comment.