Proxyman icon indicating copy to clipboard operation
Proxyman copied to clipboard

[BUG] Scripting removes the = in the form body if the value is empty

Open NghiaTranUIT opened this issue 1 year ago • 1 comments

Description

If the value of a pair key and value is an empty string (application/x-www-form-urlencoded), Proxyman Scripting removes the =, which is the incorrect format.

Steps to Reproduce

  1. Create a simple script for URL = https://httpbin.proxyman.app/post?action=bug
async function onRequest(context, url, request) {
  // console.log(request);
  console.log(url);

  // Update or Add new headers
  request.headers["X-New-Headers"] = "My-Value";

  // Done
  return request;
}
  1. Make a request
curl 'https://httpbin.proxyman.app/post?action=bug' \
-X POST \
-H 'Host: httpbin.proxyman.app' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=123' \
--proxy localhost:9090
  1. Observe that the body of the request in the Main table view is modified incorrectly ❌

Current Behavior

  • The body is: (Missing some =)
__EVENTTARGET&__EVENTARGUMENT&__VIEWSTATE=123

Expected Behavior

  • The body is intact
__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=123

NghiaTranUIT avatar Jan 14 '24 01:01 NghiaTranUIT

Fixed: https://download.proxyman.io/beta/Proxyman_4.16.0_Fix_scripting_with_form_body.dmg

NghiaTranUIT avatar Jan 14 '24 02:01 NghiaTranUIT