Skip to content
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/http): wrong req.url value #25081

Merged
merged 2 commits into from
Aug 18, 2024
Merged

fix(node/http): wrong req.url value #25081

merged 2 commits into from
Aug 18, 2024

Conversation

marvinhagemeister
Copy link
Contributor

@marvinhagemeister marvinhagemeister commented Aug 18, 2024

This PR addresses a regression introduced in #25021 that would cause the req.url parameter in Node's http server to always be a single character instead of the expected value. The regression was caused by effectively calling .indexOf() on an empty string and thus passing the wrong index for slicing.

"".indexOf("/") // -> -1
request.url.slice(-1) // effectively only giving us the last character

Fixes #25080

@marvinhagemeister marvinhagemeister enabled auto-merge (squash) August 18, 2024 15:37
@marvinhagemeister marvinhagemeister merged commit 558d2a0 into main Aug 18, 2024
17 checks passed
@marvinhagemeister marvinhagemeister deleted the node-http-req-url branch August 18, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

next.js dev server doesn't start
2 participants