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:
@@ -7,8 +7,6 @@ import (
|
||||
"net/http/httptest"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/mholt/caddy"
|
||||
)
|
||||
|
||||
func TestParseClientHello(t *testing.T) {
|
||||
@@ -287,7 +285,7 @@ func TestHeuristicFunctionsAndHandler(t *testing.T) {
|
||||
want := ch.interception
|
||||
handler := &tlsHandler{
|
||||
next: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
got, checked = r.Context().Value(caddy.CtxKey("mitm")).(bool)
|
||||
got, checked = r.Context().Value(MitmCtxKey).(bool)
|
||||
}),
|
||||
listener: newTLSListener(nil, nil),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user