mirror of
https://github.com/caddyserver/caddy.git
synced 2026-07-11 11:24:19 +00:00
Added Const for use of CtxKeys (#1511)
* Added Const for CtxKeys * Move CtxKey Const declarations * Fixed tests * fix test
This commit is contained in:
parent
96bfb9f347
commit
d5cc10f7aa
14 changed files with 39 additions and 43 deletions
|
|
@ -292,7 +292,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}()
|
||||
|
||||
w.Header().Set("Server", "Caddy")
|
||||
c := context.WithValue(r.Context(), caddy.URLPathCtxKey, r.URL.Path)
|
||||
c := context.WithValue(r.Context(), staticfiles.URLPathCtxKey, r.URL.Path)
|
||||
r = r.WithContext(c)
|
||||
|
||||
sanitizePath(r)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue