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:
Mutasem Aldmour 2021-08-08 11:27:07 +02:00 committed by GitHub
parent 6ffc46c79d
commit fc6d3ad8c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -308,11 +308,18 @@ export class HttpRequest implements INodeType {
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',
type: 'boolean',
default: true,
description: 'Follow HTTP 3xx redirects.',
description: 'Follow GET HTTP 3xx redirects.',
},
{
displayName: 'Ignore Response Code',
@ -695,6 +702,11 @@ export class HttpRequest implements INodeType {
if (options.followRedirect !== undefined) {
requestOptions.followRedirect = options.followRedirect as boolean;
}
if (options.followAllRedirects !== undefined) {
requestOptions.followAllRedirects = options.followAllRedirects as boolean;
}
if (options.ignoreResponseCode === true) {
// @ts-ignore
requestOptions.simple = false;