mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Rewrite HTTP method for stream requests in GotRequester (#1602)
This prevents encountering HTTP 405 (Method not allowed) for API requests using streaming responses like Job Artifact downloads.
This commit is contained in:
parent
b2fe87af7e
commit
a811e14d5a
@ -74,7 +74,11 @@ export async function handler(endpoint: string, options: Record<string, unknown>
|
||||
for (let i = 0; i < maxRetries; i += 1) {
|
||||
const waitTime = 2 ** i * 0.1;
|
||||
try {
|
||||
if (options.method === 'stream') return Got(endpoint, options);
|
||||
if (options.method === 'stream') {
|
||||
options.method = 'get';
|
||||
options.isStream = true;
|
||||
return Got(endpoint, options);
|
||||
}
|
||||
response = await Got(endpoint, options); // eslint-disable-line
|
||||
break;
|
||||
} catch (e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user