mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 22:23:48 +03:00
reverse_proxy: Fix NTLM auth detection
D'oh. Got mixed up in a refactoring.
This commit is contained in:
parent
8e515289cb
commit
95615f5377
1 changed files with 3 additions and 1 deletions
|
@ -19,6 +19,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/caddyserver/caddy/v2"
|
"github.com/caddyserver/caddy/v2"
|
||||||
|
@ -205,7 +206,8 @@ func (n *NTLMTransport) deleteTransportsForClient(clientAddr string) {
|
||||||
// header with values "NTLM" or "Negotiate".
|
// header with values "NTLM" or "Negotiate".
|
||||||
func requestHasAuth(req *http.Request) bool {
|
func requestHasAuth(req *http.Request) bool {
|
||||||
for _, val := range req.Header["Authorization"] {
|
for _, val := range req.Header["Authorization"] {
|
||||||
if val == "NTLM" || val == "Negotiate" {
|
if strings.HasPrefix(val, "NTLM") ||
|
||||||
|
strings.HasPrefix(val, "Negotiate") {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue