[GH-ISSUE #418] request.query parsing and url rebuilding error #417

Open
opened 2026-03-03 19:50:29 +03:00 by kerem · 1 comment
Owner

Originally created by @infchaos on GitHub (Jul 13, 2024).
Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/418

when proxing url like this one
http://xxx.xxx/test?e=123&token=xxx-xxx:xxx-xxx=
the server got the url /ajax?e=123 without the token(a base64 like value)

and I wrote such js to fix it

request.queries = {}
    for (const [k, v] of [...new URLSearchParams(new URL(url).search)]) {
       request.queries[k] = v
    }

it works,and then I got another problem
the server need a url in this format
http://xxx.xxx/test?aaa&bbb=123
but the proxy changed the url into
http://xxx.xxx/test?aaa=&bbb=123
the extra "=" make the response data invalid because the server may parse the url by regex.
is there any way to directly return the url string I computed or just return the origin url without any changes?

Originally created by @infchaos on GitHub (Jul 13, 2024). Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/418 when proxing url like this one `http://xxx.xxx/test?e=123&token=xxx-xxx:xxx-xxx=` the server got the url `/ajax?e=123` without the token(a base64 like value) and I wrote such js to fix it ``` request.queries = {} for (const [k, v] of [...new URLSearchParams(new URL(url).search)]) { request.queries[k] = v } ``` it works,and then I got another problem the server need a url in this format `http://xxx.xxx/test?aaa&bbb=123` but the proxy changed the url into `http://xxx.xxx/test?aaa=&bbb=123` the extra "=" make the response data invalid because the server may parse the url by regex. is there any way to directly return the url string I computed or just return the origin url without any changes?
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 17, 2024):

aaa=&bbb=123

It's expected as it's a standard URL Query. If the value is absent, it's displays as aaa=.

<!-- gh-comment-id:2418825476 --> @NghiaTranUIT commented on GitHub (Oct 17, 2024): ``` aaa=&bbb=123 ``` It's expected as it's a standard URL Query. If the value is absent, it's displays as `aaa=`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxyman-windows-linux#417
No description provided.