mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
✨ Add "Follow All Redirects" option to HTTP Request Node (#2046)
* redirect post/put/delete/patch requests
* add redirect all option
* ⚡ Minor improvement
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
parent
6ffc46c79d
commit
fc6d3ad8c0
|
@ -308,11 +308,18 @@ export class HttpRequest implements INodeType {
|
||||||
description: 'Returns the full reponse data instead of only the body.',
|
description: 'Returns the full reponse data instead of only the body.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Follow Redirect',
|
displayName: 'Follow All Redirects',
|
||||||
|
name: 'followAllRedirects',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
description: 'Follow non-GET HTTP 3xx redirects.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Follow GET Redirect',
|
||||||
name: 'followRedirect',
|
name: 'followRedirect',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
description: 'Follow HTTP 3xx redirects.',
|
description: 'Follow GET HTTP 3xx redirects.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Ignore Response Code',
|
displayName: 'Ignore Response Code',
|
||||||
|
@ -695,6 +702,11 @@ export class HttpRequest implements INodeType {
|
||||||
if (options.followRedirect !== undefined) {
|
if (options.followRedirect !== undefined) {
|
||||||
requestOptions.followRedirect = options.followRedirect as boolean;
|
requestOptions.followRedirect = options.followRedirect as boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.followAllRedirects !== undefined) {
|
||||||
|
requestOptions.followAllRedirects = options.followAllRedirects as boolean;
|
||||||
|
}
|
||||||
|
|
||||||
if (options.ignoreResponseCode === true) {
|
if (options.ignoreResponseCode === true) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
requestOptions.simple = false;
|
requestOptions.simple = false;
|
||||||
|
|
Loading…
Reference in a new issue