Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
reverse_proxy: Fix NTLM auth detection
D'oh. Got mixed up in a refactoring.
Matthew Holt committed
Nov 6, 2019 at 00:16 UTC
95615f537770bf98d2db67c619111ec0efc880cc
1 file changed
+3
-1
modules/caddyhttp/reverseproxy/ntlm.go
+3
-1
@@ -19,6 +19,7 @@ import (
19
"fmt"
20
"net"
21
"net/http"
22
+ "strings"
23
"sync"
24
25
"github.com/caddyserver/caddy/v2"
@@ -205,7 +206,8 @@ func (n *NTLMTransport) deleteTransportsForClient(clientAddr string) {
206
// header with values "NTLM" or "Negotiate".
207
func requestHasAuth(req *http.Request) bool {
208
for _, val := range req.Header["Authorization"] {
208
- if val == "NTLM" || val == "Negotiate" {
209
+ if strings.HasPrefix(val, "NTLM") ||
210
+ strings.HasPrefix(val, "Negotiate") {
211
return true
212
}
213
}