mirror of
https://github.com/caddyserver/caddy.git
synced 2026-06-29 21:31:41 +00:00
staticfiles: Build redirect based on rewritten URL (fixes #1706)
This commit is contained in:
parent
95a6237693
commit
f4b6f15e07
3 changed files with 20 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue