From 7861c0006f6b2cc3196bcb0d78bca4e3d7df8dfb Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Sun, 23 Jan 2022 14:13:02 +0530 Subject: [PATCH] fix: urlencoded not switching to formdata --- .../hoppscotch-app/newstore/RESTSession.ts | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/hoppscotch-app/newstore/RESTSession.ts b/packages/hoppscotch-app/newstore/RESTSession.ts index d00d7314f..2b060eba3 100644 --- a/packages/hoppscotch-app/newstore/RESTSession.ts +++ b/packages/hoppscotch-app/newstore/RESTSession.ts @@ -219,17 +219,19 @@ const dispatchers = defineDispatchers({ curr.request.body.contentType === "application/x-www-form-urlencoded" ) { return { - ...curr.request, - body: { - contentType: "multipart/form-data", - body: pipe( - curr.request.body.body, - parseRawKeyValueEntries, - A.map( - ({ key, value, active }) => - { key, value, active, isFile: false } - ) - ), + request: { + ...curr.request, + body: { + contentType: "multipart/form-data", + body: pipe( + curr.request.body.body, + parseRawKeyValueEntries, + A.map( + ({ key, value, active }) => + { key, value, active, isFile: false } + ) + ), + }, }, } }