Proxyman
Proxyman copied to clipboard
jwt string in request body gets converted to json payload when scripting is enabled
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
- Enable Scripting
- 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:
Expected Behavior
request body should remain as eyJzdGF0dXMiOiJydW5uaW5nIiwiYWN0aW9ucyI6W3sidHlwZSI6InNldCIsIm91dHB1dCI6Imxpbmtfc291cmNlIiwidmFsdWUiOiJkZWZhdWx0IiwiZG9uZSI6dHJ1ZX1dfQ==
Environment
- App version: e.g Proxyman 4.15.0
- macOS version: macOS Monterey
Thanks. I will investigate this bug and get back to you asap 👍
@theelbowclaps you can try this Beta build: https://download.proxyman.io/beta/Proxyman_4.15.0_Fix_Scripting_with_Body_String.dmg
- Fix the Script issue when it tried to parse the string to base64 data (due to unknown Content-Type)
@theelbowclaps you can try this Beta build: https://download.proxyman.io/beta/Proxyman_4.15.0_Fix_Scripting_with_Body_String.dmg
- Fix the Script issue when it tried to parse the string to base64 data (due to unknown Content-Type)
It's working great now. Thanks a bunch!