You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the console, we can see the originalUrl that was requested is /api/login?redirect=mockUrl , but it becomes /api/login after being handled by the proxy middleware.
And the URL is correct when we click the Fetch button to trigger a xhr request.
The vite-plugin-html adds a proxy handling rule for text/html type request, and uses parsedUrl.pathname which doesn't contain query params (pic below) as the path to redirect. So the problem occurs when starts a document request but the xhr requests is good.
The text was updated successfully, but these errors were encountered:
Try vite-plugin-simple-html.
It has fewer features, but as a result, far less magic required. I developed it specifically to cover my needs while not be affected by this bug, which was a blocker for me migrating to Vite.
Demo
https://codesandbox.io/p/sandbox/vite-plugin-html-redirect-demo-jhjqtn?file=%2Fvite.config.js
Reproduce steps
Redirect button
On the console, we can see the originalUrl that was requested is
/api/login?redirect=mockUrl
, but it becomes/api/login
after being handled by the proxy middleware.And the URL is correct when we click the
Fetch
button to trigger axhr request
.Reason
code
The vite-plugin-html adds a proxy handling rule for
text/html
type request, and usesparsedUrl.pathname
whichdoesn't contain query params
(pic below) as the path to redirect. So the problem occurs when starts adocument
request but thexhr
requests is good.The text was updated successfully, but these errors were encountered: