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

Incoming Request's URL should be normalized #4001

Closed
yusukebe opened this issue Aug 5, 2023 · 0 comments · Fixed by #4034
Closed

Incoming Request's URL should be normalized #4001

yusukebe opened this issue Aug 5, 2023 · 0 comments · Fixed by #4034
Labels
bug Something isn't working web-api Something that relates to a standard Web API

Comments

@yusukebe
Copy link
Contributor

yusukebe commented Aug 5, 2023

What version of Bun is running?

0.7.2

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

If you have an app like the following:

export default {
  fetch: (req: Request) => {
    console.log(req.url)
    return new Response('/')
  },
}

Then, accessing localhost:3000/../foo

curl --path-as-is -v localhost:3000/../foo

console.log() will show:

http://localhost:3000/../foo

What is the expected behavior?

It should be:

http://localhost:3000/foo

On other runtime/platforms, resolves it correctly.

What do you see instead?

No response

Additional information

Related #3831

@yusukebe yusukebe added the bug Something isn't working label Aug 5, 2023
@robobun robobun added the web-api Something that relates to a standard Web API label Aug 6, 2023
Jarred-Sumner added a commit that referenced this issue Aug 7, 2023
Jarred-Sumner added a commit that referenced this issue Aug 7, 2023
* Avoid a utf8 conversion in isDetached

* Fixes #4001

* hit the long url codepath

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
trnxdev pushed a commit to trnxdev/bun that referenced this issue Aug 9, 2023
* Avoid a utf8 conversion in isDetached

* Fixes oven-sh#4001

* hit the long url codepath

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working web-api Something that relates to a standard Web API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants