mirror of
https://github.com/golang/net.git
synced 2026-03-31 10:27:08 +09:00
socks: SOCKS5 proxy with empty password should be allowed
The behavior is accepted widely, and I found no reason to deny it. Fixes #57285
This commit is contained in:
@@ -289,7 +289,7 @@ func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter,
|
||||
case AuthMethodNotRequired:
|
||||
return nil
|
||||
case AuthMethodUsernamePassword:
|
||||
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) == 0 || len(up.Password) > 255 {
|
||||
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) > 255 {
|
||||
return errors.New("invalid username/password")
|
||||
}
|
||||
b := []byte{authUsernamePasswordVersion}
|
||||
|
||||
Reference in New Issue
Block a user