Skip to content

Conversation

sapphi-red
Copy link
Contributor

In Vite, we support rewrite option, which allows users to change req.url before it is passed to http-proxy-3.
Some users were setting req.url: '' with that option.
With http-proxy, when target is http://example.com/test, the request was proxied to http://example.com/test.
But with http-proxy-3, the request is proxied to ``http://example.com/test/` (has a trailing slash).

This PR fixes that behavior difference by adding some code to handle them.

Since req.url: '' doesn't happen normally, I'm also fine with patching this on Vite side (vitejs/vite#20679).

@williamstein
Copy link
Contributor

This seems reasonable to me.

@williamstein williamstein merged commit 98b6df4 into sagemathinc:main Aug 25, 2025
4 checks passed
@williamstein
Copy link
Contributor

This is now [email protected]

@sapphi-red sapphi-red deleted the support-empty-req-url branch September 8, 2025 04:35
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