(url: string, init?: RequestInit)
| 56 | } |
| 57 | |
| 58 | async function fetchGitLabOnce(url: string, init?: RequestInit): Promise<Response> { |
| 59 | const resolvedUrl = await resolveGitLabUrlSafely(url); |
| 60 | if (!resolvedUrl.address) { |
| 61 | return fetch(url, { ...init, redirect: 'manual' }); |
| 62 | } |
| 63 | |
| 64 | return fetchGitLabBoundToAddress({ ...resolvedUrl, address: resolvedUrl.address }, init); |
| 65 | } |
| 66 | |
| 67 | function isGitLabRedirect(status: number): boolean { |
| 68 | return status === 301 || status === 302 || status === 303 || status === 307 || status === 308; |
no test coverage detected