Switch to cors to test upload functionality (#3240)

This commit is contained in:
Justin Dalrymple 2023-05-05 11:58:48 -04:00 committed by GitHub
parent e209f05b27
commit 2e3c8a41cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -107,7 +107,7 @@ export async function defaultRequestHandler(endpoint: string, options: RequestOp
/* eslint-disable no-await-in-loop */
for (let i = 0; i < maxRetries; i += 1) {
const response = await fetch(url, { ...opts, mode: 'same-origin' });
const response = await fetch(url, { ...opts, mode: 'cors' });
if (response.ok) return parseResponse(response, asStream);
if (!retryCodes.includes(response.status)) await throwFailedRequestError(response);

View File

@ -199,7 +199,7 @@ describe('defaultRequestHandler', () => {
} as RequestOptions);
expect(MockFetch).toHaveBeenCalledWith(new URL('http://test.com/testurl'), {
mode: 'same-origin',
mode: 'cors',
});
});
@ -225,7 +225,7 @@ describe('defaultRequestHandler', () => {
} as RequestOptions);
expect(MockFetch).toHaveBeenCalledWith(new URL('http://test.com/testurl/123?test=4'), {
mode: 'same-origin',
mode: 'cors',
});
});
@ -251,7 +251,7 @@ describe('defaultRequestHandler', () => {
} as RequestOptions);
expect(MockFetch).toHaveBeenCalledWith(new URL('http://test.com/projects/testurl/123?test=4'), {
mode: 'same-origin',
mode: 'cors',
});
await defaultRequestHandler('123/testurl', {
@ -260,7 +260,7 @@ describe('defaultRequestHandler', () => {
} as RequestOptions);
expect(MockFetch).toHaveBeenCalledWith(new URL('http://test.com/projects/123/testurl?test=4'), {
mode: 'same-origin',
mode: 'cors',
});
await defaultRequestHandler('123/testurl', {
@ -269,7 +269,7 @@ describe('defaultRequestHandler', () => {
} as RequestOptions);
expect(MockFetch).toHaveBeenCalledWith(new URL('http://test.com/projects/123/testurl?test=4'), {
mode: 'same-origin',
mode: 'cors',
});
});
});