Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: urlencoded not switching to formdata

Andrew Bastin7861c0006f6b
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: <HoppRESTReqBody>{
- contentType: "multipart/form-data",
- body: pipe(
- curr.request.body.body,
- parseRawKeyValueEntries,
- A.map(
- ({ key, value, active }) =>
- <FormDataKeyValue>{ key, value, active, isFile: false }
- )
- ),
+ request: {
+ ...curr.request,
+ body: <HoppRESTReqBody>{
+ contentType: "multipart/form-data",
+ body: pipe(
+ curr.request.body.body,
+ parseRawKeyValueEntries,
+ A.map(
+ ({ key, value, active }) =>
+ <FormDataKeyValue>{ key, value, active, isFile: false }
+ )
+ ),
+ },
},
}
}