mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-11 19:18:46 +00:00
feat(lib): enable multiple consecutive slash support
Replaces #808 Closes #754 Some web applications require the ability to include multiple consecutive slashes in a URL. This could be for optional path variables or for wiki article titles that start with a leading slash. I wasn't aware that the RFC allowed this. Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
@@ -200,7 +200,12 @@ func (s *Server) respondWithStatus(w http.ResponseWriter, r *http.Request, msg s
|
||||
}
|
||||
|
||||
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
s.mux.ServeHTTP(w, r)
|
||||
switch strings.HasPrefix(r.URL.Path, anubis.StaticPath) {
|
||||
case true:
|
||||
s.mux.ServeHTTP(w, r)
|
||||
case false:
|
||||
s.maybeReverseProxyOrPage(w, r)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) stripBasePrefixFromRequest(r *http.Request) *http.Request {
|
||||
|
||||
Reference in New Issue
Block a user