mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Ensure maxRedirects is used for any http request defining it (#8706)
This commit is contained in:
committed by
GitHub
parent
8c4a744c56
commit
246c988b93
@@ -480,16 +480,14 @@ export async function parseRequestObject(requestObject: IRequestOptions) {
|
||||
}
|
||||
|
||||
// Axios will follow redirects by default, so we simply tell it otherwise if needed.
|
||||
const { method } = requestObject;
|
||||
if (
|
||||
requestObject.followRedirect === false &&
|
||||
((requestObject.method as string | undefined) || 'get').toLowerCase() === 'get'
|
||||
) {
|
||||
axiosConfig.maxRedirects = 0;
|
||||
}
|
||||
if (
|
||||
requestObject.followAllRedirects === false &&
|
||||
((requestObject.method as string | undefined) || 'get').toLowerCase() !== 'get'
|
||||
(requestObject.followRedirect !== false &&
|
||||
(!method || method === 'GET' || method === 'HEAD')) ||
|
||||
requestObject.followAllRedirects
|
||||
) {
|
||||
axiosConfig.maxRedirects = requestObject.maxRedirects;
|
||||
} else {
|
||||
axiosConfig.maxRedirects = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user