From fd3bf0e63e19b605db64c8bba4fd1789b6e52d0f Mon Sep 17 00:00:00 2001 From: shuaixr <1025sxr@gmail.com> Date: Thu, 6 Feb 2025 01:12:30 -0800 Subject: [PATCH] fix: ensure correct body for application/x-www-form-urlencoded in all code exports (#4712) --- packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts b/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts index ce89ff74..58e8edac 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),