mirror of
https://github.com/caddyserver/caddy.git
synced 2026-07-10 19:04:22 +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
|
|
@ -14,7 +14,6 @@ import (
|
|||
|
||||
"os"
|
||||
|
||||
"github.com/mholt/caddy"
|
||||
"github.com/russross/blackfriday"
|
||||
)
|
||||
|
||||
|
|
@ -349,7 +348,7 @@ func (c Context) Files(name string) ([]string, error) {
|
|||
// IsMITM returns true if it seems likely that the TLS connection
|
||||
// is being intercepted.
|
||||
func (c Context) IsMITM() bool {
|
||||
if val, ok := c.Req.Context().Value(caddy.CtxKey("mitm")).(bool); ok {
|
||||
if val, ok := c.Req.Context().Value(MitmCtxKey).(bool); ok {
|
||||
return val
|
||||
}
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue