ProxymanApp / ProxymanApp/Proxyman

jwt string in request body gets converted to json payload when scripting is enabled

Open
#1,894 3 comments 0 reactions 1 assignee View on GitHub

@NghiaTranUIT is already working on this.

Since Dec 23, 2023.

✅ Done bug
Dominant language
No language data
Stars
7k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

Description

I'm working with an API that uses custom "Content-Type" header and the request body is a jwt string.
Whenever I enable Scripting, the jwt in the body gets converted to a json payload. My script does not even contain any logic that modifies the request.

async function onRequest(context, url, request) {
  return request;
}

Steps to Reproduce

  1. Enable Scripting
  2. run:
curl -X POST https://www.example.com -H "Content-Type: application/my-custom-type" --data-raw "eyJzdGF0dXMiOiJydW5uaW5nIiwiYWN0aW9ucyI6W3sidHlwZSI6InNldCIsIm91dHB1dCI6Imxpbmtfc291cmNlIiwidmFsdWUiOiJkZWZhdWx0IiwiZG9uZSI6dHJ1ZX1dfQ==" --proxy http://localhost:9090

Current Behavior

Payload is altered:
image

Expected Behavior

request body should remain as eyJzdGF0dXMiOiJydW5uaW5nIiwiYWN0aW9ucyI6W3sidHlwZSI6InNldCIsIm91dHB1dCI6Imxpbmtfc291cmNlIiwidmFsdWUiOiJkZWZhdWx0IiwiZG9uZSI6dHJ1ZX1dfQ==

Environment

  • App version: e.g Proxyman 4.15.0
  • macOS version: macOS Monterey

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.