From 29ec73c80b8517e16100102beb99db0166bb87ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B2=B3?= Date: Mon, 16 Dec 2019 22:18:49 +0800 Subject: [PATCH] add Proxy-Authirization on basic auth --- lib/common/util.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/common/util.go b/lib/common/util.go index 67f58cb..1db0d27 100755 --- a/lib/common/util.go +++ b/lib/common/util.go @@ -51,7 +51,10 @@ func DomainCheck(domain string) bool { func CheckAuth(r *http.Request, user, passwd string) bool { s := strings.SplitN(r.Header.Get("Authorization"), " ", 2) if len(s) != 2 { - return false + s = strings.SplitN(r.Header.Get("Proxy-Authorization"), " ", 2) + if len(s) != 2 { + return false + } } b, err := base64.StdEncoding.DecodeString(s[1])