Repository navigation
fix(uws): handle failing upgrade hooks and log rejection body errors - #226
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pre-merge checks:
|
- turn a throwing `upgrade` hook into a logged 500 instead of an unhandled rejection (uWS doesn't await the handler) - log a rejection body that fails mid-stream instead of dropping the error - send `Response.error()` (status 0) as 500 and strip invalid characters (CR/LF) from the status text
pi0x
force-pushed
the
fix/uws-upgrade-rejection-robustness
branch
from
November 11, 2026 13:28
349522d to
a62f645
Compare
pi0
approved these changes
Nov 11, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #223, and the uWS counterpart of #224 (Node).
Changes
upgradehook was an unhandled rejection. uWS doesn't await theupgradehandler, so the error escaped. The adapter now logs it and responds with a 500, matching the Node adapter.Response.error()(status 0) is sent as a 500, where it used to produce a0status line.statusText, so a CR/LF can't split the response.Tests
New
uws (upgrade rejection robustness)tests cover each item. All four fail againstmainand pass with this change.🤖 Generated with AI assistant