mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
🐛 Do not overwrite accept header if set on HTTP Request Node
This commit is contained in:
parent
9be3b97cc3
commit
f4ed583359
|
@ -797,13 +797,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 (requestOptions.headers!['accept'] === undefined) {
|
||||
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') {
|
||||
|
|
Loading…
Reference in a new issue