-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERR_HTTP_HEADERS_SENT with 5.3.0 / 5.3.1 and https-proxy-agent configured #17520
Comments
Start a new pull request in StackBlitz Codeflow. |
Encountered the same issue. The exception comes from a commit introduced in In my case, I observed that the Three solutions:
|
This seems the be the best-fix for me, but I'm not too familiar with the original change. @johnhunter @sapphi-red do you have thoughts on this? |
Option 2 sounds like a good solution. I'll have a proper look when I'm back at my desk. |
I'll address this along with #17562 |
Describe the bug
In 5.3.0 7b0a65e added custom logic that utilizes the
proxyReq
event to set the origin header. This throws an ERR_HTTP_HEADERS_SENT error for me when using using with https-proxy-agent (for example required in setups in which a corporate proxy is in place). I suspect the problem is the same as described in chimurai/http-proxy-middleware#957 and similar / related to the problem described in chimurai/http-proxy-middleware#472 (explanation provided in chimurai/http-proxy-middleware#472 (comment)).When downgrading to 5.2.13 everything works again.
Reproduction
https://stackblitz.com/edit/github-sadccs?file=src%2FApp.vue,vite.config.js
Steps to reproduce
Run npm install
Replace https://example.org with an actual https proxy in vite.config.js (i don't know a public available one, sorry)
Run npm run dev
First click on the "Without proxy agent" button, you should see the expected result then.
Now click on the "With proxy agent" button, the ERR_HTTP_HEADERS_SENT should appear in the console.
System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: