mirror of
https://github.com/caddyserver/caddy.git
synced 2026-11-13 04:04:14 +00:00
staticfiles: Build redirect based on rewritten URL (fixes #1706)
This commit is contained in:
3 files changed
+20
-13
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user