google / go-safeweb

Secure-by-default HTTP servers in Go.
Apache License 2.0
1.43k stars 81 forks source link

Provide a StripPrefix utility #316

Closed empijei closed 3 years ago

empijei commented 3 years ago

Without it static file serving is practically useless: users can only serve static files from the root or mimic the site structure in the static files.

For example if a FileServer is registered on "/static" and a request comes from "/static/foo.css" the FileServer will not lookup for a file called "/static/foo.css" but for one called "static/static/foo.css".

While this is workable it's definitely not a good UX.