Fix bug in HTTP Request node with raw data and file response

This commit is contained in:
Jan Oberhauser 2021-03-02 10:18:39 +01:00
parent f13a2781a6
commit 44100dc675

View file

@ -813,11 +813,14 @@ export class HttpRequest implements INodeType {
if (responseFormat === 'file') {
requestOptions.encoding = null;
requestOptions.body = JSON.stringify(requestOptions.body);
if (requestOptions.headers === undefined) {
requestOptions.headers = {};
if (options.bodyContentType !== 'raw') {
requestOptions.body = JSON.stringify(requestOptions.body);
if (requestOptions.headers === undefined) {
requestOptions.headers = {};
}
requestOptions.headers['Content-Type'] = 'application/json';
}
requestOptions.headers['Content-Type'] = 'application/json';
} else if (options.bodyContentType === 'raw') {
requestOptions.json = false;
} else {