staticfiles: Build redirect based on rewritten URL (fixes #1706)

This commit is contained in:
Matthew Holt
2017-06-07 14:40:17 -06:00
parent 95a6237693
commit f4b6f15e07
3 changed files with 20 additions and 13 deletions

View File

@@ -352,6 +352,8 @@ func (s *Server) serveHTTP(w http.ResponseWriter, r *http.Request) (int, error)
// look up the virtualhost; if no match, serve error
vhost, pathPrefix := s.vhosts.Match(hostname + r.URL.Path)
c := context.WithValue(r.Context(), caddy.CtxKey("path_prefix"), pathPrefix)
r = r.WithContext(c)
if vhost == nil {
// check for ACME challenge even if vhost is nil;