Fix http proxy auth

This commit is contained in:
isnowly 2022-12-18 15:41:14 +08:00 committed by GitHub
parent bdf4eb1552
commit e4b763450c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ func HandleConnection(ctx context.Context, conn net.Conn, reader *std_bufio.Read
if authenticator != nil {
var authOk bool
authorization := request.Header.Get("Proxy-Authorization")
if strings.HasPrefix(authorization, "BASIC ") {
if strings.HasPrefix(authorization, "Basic ") {
userPassword, _ := base64.URLEncoding.DecodeString(authorization[6:])
userPswdArr := strings.SplitN(string(userPassword), ":", 2)
authOk = authenticator.Verify(userPswdArr[0], userPswdArr[1])