babashka / http-server

Serve static assets
MIT License
77 stars 8 forks source link

Unescape URLs? #3

Closed orestis closed 4 months ago

orestis commented 1 year ago

I am serving some crawled assets that contain URLs like:

../assets/css/screen.css%3Fv=bdeae747df.css - the file in the filesystem is named screen.css.

If I edit the link to ../assets/css/screen.css?v=bdeae747df.css then the file is loaded fine, otherwise it's a 404. I'm not 100% sure on if this is correct behaviour, but I expect that web-servers should un-escape URLs?

borkdude commented 1 year ago

@orestis I don't think that's how it should work. If you escape the query parameter question mark, it means you want to visit the route that includes a question mark. I confirmed this using Python's http-server:

Screenshot 2022-11-26 at 18 43 09