mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
🐛 Fix useQuerystring in combination with x-www-form-urlencoded #2348
This commit is contained in:
parent
d25353b6e6
commit
cba2874c2e
|
@ -162,16 +162,19 @@ async function parseRequestObject(requestObject: IDataObject) {
|
||||||
// and also using formData. Request lib takes precedence for the formData.
|
// and also using formData. Request lib takes precedence for the formData.
|
||||||
// We will do the same.
|
// We will do the same.
|
||||||
// Merge body and form properties.
|
// Merge body and form properties.
|
||||||
// @ts-ignore
|
if (typeof requestObject.body === 'string') {
|
||||||
axiosConfig.data =
|
axiosConfig.data = requestObject.body;
|
||||||
typeof requestObject.body === 'string'
|
} else {
|
||||||
? requestObject.body
|
const allData = Object.assign(requestObject.body || {}, requestObject.form || {}) as Record<
|
||||||
: new URLSearchParams(
|
|
||||||
Object.assign(requestObject.body || {}, requestObject.form || {}) as Record<
|
|
||||||
string,
|
string,
|
||||||
string
|
string
|
||||||
>,
|
>;
|
||||||
);
|
if (requestObject.useQuerystring === true) {
|
||||||
|
axiosConfig.data = stringify(allData, { arrayFormat: 'repeat' });
|
||||||
|
} else {
|
||||||
|
axiosConfig.data = stringify(allData);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (contentType && contentType.includes('multipart/form-data') !== false) {
|
} else if (contentType && contentType.includes('multipart/form-data') !== false) {
|
||||||
if (requestObject.formData !== undefined && requestObject.formData instanceof FormData) {
|
if (requestObject.formData !== undefined && requestObject.formData instanceof FormData) {
|
||||||
axiosConfig.data = requestObject.formData;
|
axiosConfig.data = requestObject.formData;
|
||||||
|
|
Loading…
Reference in a new issue