Browse Source

fix: ensure correct body for application/x-www-form-urlencoded in all code exports (#4712)

shuaixr 1 month ago
parent
commit
fd3bf0e63e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts

+ 4 - 0
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),