-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix(node): Fix malformed URLs crashing the server in certain cases #6746
Conversation
🦋 Changeset detectedLatest commit: 5b93104 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
||
for (const weirdUrl of weirdURLs) { | ||
const fetchResult = await fixture.fetch(weirdUrl); | ||
expect([400, 500]).to.include( |
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.
Certain URLs here return 500
instead of 400
because they pass the encodeUri
, decodeUri
, new URI
stuff, but they fail later on in the server.
Changes
decodeUri
,encodeUri
andnew URL
can all throw errors in some cases. This would crash the server completely in certain cases.I checked how Express and other servers handle this, and most of them just try catch it, so figured we can do the same.
Fix #6736
Testing
Added a test
Docs
N/A