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

This commit is contained in:
Matthew Holt committed 2017-06-07 14:40:17 -06:00
1 parent 95a6237693
commit f4b6f15e07
3 files changed
+20 -13

No files matched your search

+2
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;