mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
⚡ Set reasonable defaults for HTTP Request node "accept" header
This commit is contained in:
@@ -540,6 +540,7 @@ export class HttpRequest implements INodeType {
|
||||
headers: {},
|
||||
method: requestMethod,
|
||||
uri: url,
|
||||
gzip: true,
|
||||
rejectUnauthorized: !this.getNodeParameter('allowUnauthorizedCerts', itemIndex, false) as boolean,
|
||||
};
|
||||
|
||||
@@ -640,6 +641,14 @@ export class HttpRequest implements INodeType {
|
||||
};
|
||||
}
|
||||
|
||||
if (responseFormat === 'json') {
|
||||
requestOptions.headers!['accept'] = 'application/json,text/*;q=0.99';
|
||||
} else if (responseFormat === 'string') {
|
||||
requestOptions.headers!['accept'] = 'application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, */*;q=0.1';
|
||||
} else {
|
||||
requestOptions.headers!['accept'] = 'application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7';
|
||||
}
|
||||
|
||||
if (responseFormat === 'file') {
|
||||
requestOptions.encoding = null;
|
||||
} else if(options.bodyContentType === 'raw') {
|
||||
|
||||
Reference in New Issue
Block a user