-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
fix(dev): conditionally set status message for HTTP/2 compatibility #13460
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
base: dev
Are you sure you want to change the base?
fix(dev): conditionally set status message for HTTP/2 compatibility #13460
Conversation
|
Hi @jacob-briscoe, Welcome, and thank you for contributing to React Router! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected]. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request conditionally sets the HTTP status message for responses based on the HTTP version to ensure HTTP/2 compatibility and updates the contributors list.
- Conditionally sets statusMessage in the node adapter based on HTTP version
- Adds a new contributor in contributors.yml
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/react-router-dev/vite/node-adapter.ts | Introduces a conditional check to set the status message only for HTTP versions that support it. |
contributors.yml | Adds a new contributor entry to the list. |
Comments suppressed due to low confidence (1)
packages/react-router-dev/vite/node-adapter.ts:91
- When nodeRes.req is undefined, the code assumes an HTTP/1.x environment; ensure that this assumption holds true in all deployment scenarios to avoid setting a statusMessage on protocols where it may not be supported.
if (!nodeRes.req || nodeRes.req.httpVersionMajor < 2) {
Do we need to make this same change in |
Good question, I'll take a look. Thank you! |
adds link to RFC info on http/2 status messages Co-authored-by: Matt Brophy <[email protected]>
I looked into this a little more and noticed that express doesn't support http/2 yet. So, for this PR no we don't necessarily have to implement this because when using express with ssl we don't receive the warning about the header being sent. I did attempt to get express to use http/2 but didn't have much luck with it. There are a couple of solutions out there, one of which is spdy but it doesn't seem to be active nor does it support newer versions of node. I also attempted node's built-in http2 module but there seems to be a compat issue with express because I keep getting server crashes -- unrelated to this particular header issue. I don't mind introducing the logic here to handle this for the future, but it isn't currently an issue. RE express http/2 initiative: expressjs/express#5462 |
closes #13459