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: ensure correct body for application/x-www-form-urlencoded in all code exports (#4712)

shuaixrfd3bf0e63e19
diff --git a/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts b/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts
index ce89ff74d..58e8edac3 100644
--- a/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts
+++ b/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts
@@ -468,6 +468,10 @@ export const resolvesEnvsInBody = (
if (isJSONContentType(body.contentType))
bodyContent = stripComments(body.body)
+ if (body.contentType === "application/x-www-form-urlencoded") {
+ bodyContent = body.body
+ }
+
return {
contentType: body.contentType,
body: parseTemplateString(bodyContent, env.variables, false, true),