feat(HTTP Request Node): Add option to disable lowercase headers (#10154)

This commit is contained in:
Marcus 2024-07-29 09:32:42 +02:00 committed by GitHub
parent d165b33cea
commit 5aba69bcf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -806,6 +806,13 @@ export class HttpRequestV3 implements INodeType {
],
default: 'brackets',
},
{
displayName: 'Lowercase Headers',
name: 'lowercaseHeaders',
type: 'boolean',
default: true,
description: 'Whether to lowercase header names',
},
{
displayName: 'Redirects',
name: 'redirect',
@ -1388,6 +1395,7 @@ export class HttpRequestV3 implements INodeType {
allowUnauthorizedCerts,
queryParameterArrays,
response,
lowercaseHeaders,
} = this.getNodeParameter('options', itemIndex, {}) as {
batching: { batch: { batchSize: number; batchInterval: number } };
proxy: string;
@ -1398,6 +1406,7 @@ export class HttpRequestV3 implements INodeType {
response: { neverError: boolean; responseFormat: string; fullResponse: boolean };
};
redirect: { redirect: { maxRedirects: number; followRedirects: boolean } };
lowercaseHeaders: boolean;
};
const url = this.getNodeParameter('url', itemIndex) as string;
@ -1611,7 +1620,9 @@ export class HttpRequestV3 implements INodeType {
}
requestOptions.headers = {
...requestOptions.headers,
...keysToLowercase(additionalHeaders),
...(lowercaseHeaders === undefined || lowercaseHeaders
? keysToLowercase(additionalHeaders)
: additionalHeaders),
};
}