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

Filenames containing the hash character (#) does not get this character encoded in the URL #566

Open
ericvillemure opened this issue Nov 6, 2019 · 3 comments

Comments

@ericvillemure
Copy link

Here are the steps to reproduce:
in Windows command line:

C:\Users\xxx\temp>echo Hello > world#.txt

C:\Users\xxx\temp>npx serve

   ┌──────────────────────────────────────────────────┐
   │                                                  │
   │   Serving!                                       │
   │                                                  │
   │   - Local:            http://localhost:62677     │
   │   - On Your Network:  http://10.0.75.1:62677     │
   │                                                  │
   │   This port was picked because 5000 is in use.   │
   │                                                  │
   │   Copied local address to clipboard!             │
   │                                                  │
   └──────────────────────────────────────────────────┘

Open your browser and click on the world#.txt fileyou will get a 404 error. This is because the hash key is not url encoded. The correct URL should have been http://localhost:62677/world%23.txt instead of http://localhost:62677/world#.txt

In fact if you manually change the URL to http://localhost:62677/world%23.txt it will work and display Hello

@sym233
Copy link

sym233 commented Jun 4, 2021

Aha, I just found this bug

@sym233
Copy link

sym233 commented Jun 4, 2021

I create a PR to fix that
vercel/serve-handler#150

warren-bank added a commit to warren-bank/node-serve that referenced this issue Dec 22, 2021
@warren-bank
Copy link

shameless self-promotion alert:
this issue is fixed in my @warren-bank/serve fork of serve

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

No branches or pull requests

3 participants