mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(HTTP Request Node): Correctly doesn't redirect on non GET method (#6132)
Fixed ingnored parameter for redirect
This commit is contained in:
@@ -39,7 +39,7 @@ export class HttpRequestV3 implements INodeType {
|
||||
this.description = {
|
||||
...baseDescription,
|
||||
subtitle: '={{$parameter["method"] + ": " + $parameter["url"]}}',
|
||||
version: [3, 4],
|
||||
version: [3, 4, 4.1],
|
||||
defaults: {
|
||||
name: 'HTTP Request',
|
||||
color: '#2200DD',
|
||||
@@ -1104,6 +1104,11 @@ export class HttpRequestV3 implements INodeType {
|
||||
if (autoDetectResponseFormat || fullResponse) {
|
||||
requestOptions.resolveWithFullResponse = true;
|
||||
}
|
||||
|
||||
if (requestOptions.method !== 'GET' && nodeVersion >= 4.1) {
|
||||
requestOptions = { ...requestOptions, followAllRedirects: false };
|
||||
}
|
||||
|
||||
const defaultRedirect = nodeVersion >= 4 && redirect === undefined;
|
||||
|
||||
if (redirect?.redirect?.followRedirects || defaultRedirect) {
|
||||
@@ -1129,7 +1134,6 @@ export class HttpRequestV3 implements INodeType {
|
||||
// set default timeout to 1 hour
|
||||
requestOptions.timeout = 3600000;
|
||||
}
|
||||
|
||||
if (sendQuery && queryParameterArrays) {
|
||||
Object.assign(requestOptions, {
|
||||
qsStringifyOptions: { arrayFormat: queryParameterArrays },
|
||||
@@ -1346,7 +1350,6 @@ export class HttpRequestV3 implements INodeType {
|
||||
'application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7';
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
this.sendMessageToUI(sanitizeUiMessage(requestOptions, authDataKeys));
|
||||
} catch (e) {}
|
||||
|
||||
Reference in New Issue
Block a user