Comparing version
@@ -73,2 +73,24 @@ "use strict"; | ||
} | ||
async function generateContentLengthHeader(formData, headers) { | ||
if (!formData || !formData.getLength) { | ||
return; | ||
} | ||
try { | ||
const length = await new Promise((res, rej) => { | ||
formData.getLength((error, length) => { | ||
if (error) { | ||
rej(error); | ||
return; | ||
} | ||
res(length); | ||
}); | ||
}); | ||
headers = Object.assign(headers, { | ||
'content-length': length, | ||
}); | ||
} | ||
catch (error) { | ||
n8n_workflow_1.LoggerProxy.error('Unable to calculate form data length', { error }); | ||
} | ||
} | ||
async function parseRequestObject(requestObject) { | ||
@@ -109,2 +131,3 @@ var _a, _b, _c, _d; | ||
axiosConfig.headers = Object.assign(axiosConfig.headers || {}, headers); | ||
await generateContentLengthHeader(axiosConfig.data, axiosConfig.headers); | ||
} | ||
@@ -143,2 +166,3 @@ else { | ||
axiosConfig.headers = Object.assign(axiosConfig.headers || {}, headers); | ||
await generateContentLengthHeader(axiosConfig.data, axiosConfig.headers); | ||
} | ||
@@ -145,0 +169,0 @@ else if (requestObject.body !== undefined) { |
{ | ||
"name": "n8n-core", | ||
"version": "0.92.0", | ||
"version": "0.93.0", | ||
"description": "Core functionality of n8n", | ||
@@ -53,3 +53,3 @@ "license": "SEE LICENSE IN LICENSE.md", | ||
"mime-types": "^2.1.27", | ||
"n8n-workflow": "~0.75.0", | ||
"n8n-workflow": "~0.76.0", | ||
"oauth-1.0a": "^2.2.6", | ||
@@ -56,0 +56,0 @@ "p-cancelable": "^2.0.0", |
Sorry, the diff of this file is not supported yet
351703
0.43%4613
0.52%+ Added
- Removed
Updated