mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-13 10:42:16 -04: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:
@@ -197,3 +197,16 @@ var EmptyNext = HandlerFunc(func(w http.ResponseWriter, r *http.Request) (int, e
|
||||
func SameNext(next1, next2 Handler) bool {
|
||||
return fmt.Sprintf("%v", next1) == fmt.Sprintf("%v", next2)
|
||||
}
|
||||
|
||||
// Context key constants
|
||||
const (
|
||||
// URIxRewriteCtxKey is a context key used to store original unrewritten
|
||||
// URI in context.WithValue
|
||||
URIxRewriteCtxKey caddy.CtxKey = "caddy_rewrite_original_uri"
|
||||
|
||||
// RemoteUserCtxKey is a context key used to store remote user for request
|
||||
RemoteUserCtxKey caddy.CtxKey = "remote_user"
|
||||
|
||||
// MitmCtxKey stores Mitm result
|
||||
MitmCtxKey caddy.CtxKey = "mitm"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user