Browse Source

reverse_proxy: Fix NTLM auth detection

D'oh. Got mixed up in a refactoring.
master
Matthew Holt 5 years ago
parent
commit
95615f5377
No known key found for this signature in database GPG Key ID: 2A349DD577D586A5
  1. 4
      modules/caddyhttp/reverseproxy/ntlm.go

4
modules/caddyhttp/reverseproxy/ntlm.go

@ -19,6 +19,7 @@ import (
"fmt"
"net"
"net/http"
"strings"
"sync"
"github.com/caddyserver/caddy/v2"
@ -205,7 +206,8 @@ func (n *NTLMTransport) deleteTransportsForClient(clientAddr string) {
// header with values "NTLM" or "Negotiate".
func requestHasAuth(req *http.Request) bool {
for _, val := range req.Header["Authorization"] {
if val == "NTLM" || val == "Negotiate" {
if strings.HasPrefix(val, "NTLM") ||
strings.HasPrefix(val, "Negotiate") {
return true
}
}

Loading…
Cancel
Save