Skip to content

Commit 3379050

Browse files
committed
test setting mode cors
1 parent 472be20 commit 3379050

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

util.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,33 @@ const mod = {
4949
if (State.token)
5050
headers['Authorization'] = `Bearer ${ State.token }`;
5151

52+
const mode = 'cors';
53+
5254
return {
5355
get: (path, _headers = {}) => mod._fetch(mod._url(State, path), {
5456
headers: Object.assign(mod.clone(headers), _headers),
57+
mode,
5558
}),
5659
put: (path, body, _headers = {}) => mod._fetch(mod._url(State, path), {
5760
headers: Object.assign(mod.clone(headers), _headers),
5861
method: 'PUT',
5962
body: JSON.stringify(_headers).includes('charset=binary') ? body : JSON.stringify(body),
63+
mode,
6064
}),
6165
delete: (path, _headers = {}) => mod._fetch(mod._url(State, path), {
6266
headers: Object.assign(mod.clone(headers), _headers),
6367
method: 'DELETE',
68+
mode,
6469
}),
6570
head: path => mod._fetch(mod._url(State, path), {
6671
headers,
6772
method: 'HEAD',
73+
mode,
6874
}),
6975
options: (path, _headers = {}) => mod._fetch(mod._url(State, path), {
7076
headers: Object.assign(mod.clone(headers), _headers),
7177
method: 'OPTIONS',
78+
mode,
7279
}),
7380
};
7481
},

0 commit comments

Comments
 (0)