add Proxy-Authirization on basic auth

pull/310/head
刘河 2019-12-16 22:18:49 +08:00
parent a59a0922ca
commit 29ec73c80b
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ func DomainCheck(domain string) bool {
func CheckAuth(r *http.Request, user, passwd string) bool { func CheckAuth(r *http.Request, user, passwd string) bool {
s := strings.SplitN(r.Header.Get("Authorization"), " ", 2) s := strings.SplitN(r.Header.Get("Authorization"), " ", 2)
if len(s) != 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]) b, err := base64.StdEncoding.DecodeString(s[1])