diff --git a/src/request.js b/src/request.js index 95fd75ee47..b096aa78ce 100644 --- a/src/request.js +++ b/src/request.js @@ -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