fix: don't interrupt redirect handling when manual redirect is passed-in in configs

This commit is contained in:
Julian Lam
2026-04-20 16:38:35 -04:00
parent 7d6cdff9be
commit c59513ca6f

View File

@@ -135,7 +135,7 @@ async function call(url, method, { body, timeout, jar, ...config } = {}) {
const response = await fetchImpl(currentUrl, opts);
// Handle redirects
if ([301, 302, 307, 308].includes(response.status)) {
if (config.redirect !== 'manual' && [301, 302, 307, 308].includes(response.status)) {
const location = response.headers.get('location');
if (!location) break;
// Handle relative URLs