Skip to content

Node.js based forum software built for the modern web

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

Julian Lambb45c52aa6fc
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