google / go-safeweb

Secure-by-default HTTP servers in Go.
Apache License 2.0
854 stars 67 forks source link

Provide a StripPrefix utility #325

Closed kele closed 3 years ago

kele commented 3 years ago

Notable difference from the net/http.StripPrefix: it panics when a prefix cannot be matched. This is clearly a server configuration error.

In order to reduce complexity, the IncomingRequest.URL field is no longer there and was replaced by a method. IncomingRequest used to contain req and URL fields, the latter referencing the former. Removing the URL field removed the cross-referencing.

Fixes #316.