Skip to content

Fix option.target can't contains question mark#1334

Open
lf541512 wants to merge 1 commit intohttp-party:masterfrom
lf541512:master
Open

Fix option.target can't contains question mark#1334
lf541512 wants to merge 1 commit intohttp-party:masterfrom
lf541512:master

Conversation

@lf541512
Copy link
Copy Markdown

fix case target: http://www.example.com?project=.example&path=,and incoming requrest with query _t=123456

pi0 added a commit to unjs/httpxy that referenced this pull request Mar 25, 2026
When the proxy target URL contains a query string (e.g., `http://example.com/api?key=val`),
it was silently dropped because `setupOutgoing` only read `.pathname` from the target URL.
Now the target's `.search` is extracted and properly merged with any request query string,
using `&` as separator when both are present.

Upstream: http-party/node-http-proxy#1334
pi0 added a commit to unjs/httpxy that referenced this pull request Mar 25, 2026
When the proxy target URL contains a query string (e.g., `http://example.com/api?key=val`),
it was silently dropped because `setupOutgoing` only read `.pathname` from the target URL.
Now the target's `.search` is extracted and properly merged with any request query string,
using `&` as separator when both are present.

Upstream: http-party/node-http-proxy#1334
@pi0
Copy link
Copy Markdown

pi0 commented Mar 25, 2026

This issue has been fixed in unjs/httpxy#117.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants