mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
🐛 Fix bug with responseFormat "file" for POST-Requests
This commit is contained in:
parent
e272c69f07
commit
4165fad307
|
@ -772,6 +772,19 @@ export class HttpRequest implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
if (responseFormat === 'file') {
|
||||
requestOptions.encoding = null;
|
||||
requestOptions.body = JSON.stringify(requestOptions.body);
|
||||
if (requestOptions.headers === undefined) {
|
||||
requestOptions.headers = {};
|
||||
}
|
||||
requestOptions.headers['Content-Type'] = 'application/json';
|
||||
} else if (options.bodyContentType === 'raw') {
|
||||
requestOptions.json = false;
|
||||
} else {
|
||||
requestOptions.json = true;
|
||||
}
|
||||
|
||||
// Add Content Type if any are set
|
||||
if (options.bodyContentCustomMimeType) {
|
||||
if(requestOptions.headers === undefined) {
|
||||
|
@ -808,14 +821,6 @@ export class HttpRequest implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
if (responseFormat === 'file') {
|
||||
requestOptions.encoding = null;
|
||||
} else if(options.bodyContentType === 'raw') {
|
||||
requestOptions.json = false;
|
||||
} else {
|
||||
requestOptions.json = true;
|
||||
}
|
||||
|
||||
// Now that the options are all set make the actual http request
|
||||
if (oAuth1Api !== undefined) {
|
||||
requestPromises.push(this.helpers.requestOAuth1.call(this, 'oAuth1Api', requestOptions));
|
||||
|
|
Loading…
Reference in a new issue