mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Switch to cors to test upload functionality (#3240)
This commit is contained in:
parent
e209f05b27
commit
2e3c8a41cd
@ -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);
|
||||
|
||||
@ -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',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user