mirror of
https://github.com/v2ray/v2ray-core.git
synced 2024-04-21 12:31:52 +00:00
Merge branch 'master' into 2725
This commit is contained in:
@@ -111,7 +111,7 @@ Start:
|
||||
if len(s.config.Accounts) > 0 {
|
||||
user, pass, ok := parseBasicAuth(request.Header.Get("Proxy-Authorization"))
|
||||
if !ok || !s.config.HasAccount(user, pass) {
|
||||
return common.Error2(conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic realm=\"proxy\"\r\n\r\n")))
|
||||
return common.Error2(conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic realm=\"proxy\"\r\nConnection: close\r\n\r\n")))
|
||||
}
|
||||
if inbound != nil {
|
||||
inbound.User.Email = user
|
||||
|
||||
@@ -190,13 +190,12 @@ func (v *TimedUserValidator) Remove(email string) bool {
|
||||
v.Lock()
|
||||
defer v.Unlock()
|
||||
|
||||
email = strings.ToLower(email)
|
||||
idx := -1
|
||||
for i, u := range v.users {
|
||||
if strings.EqualFold(u.user.Email, email) {
|
||||
for i := range v.users {
|
||||
if strings.EqualFold(v.users[i].user.Email, email) {
|
||||
idx = i
|
||||
var cmdkeyfl [16]byte
|
||||
copy(cmdkeyfl[:], u.user.Account.(*MemoryAccount).ID.CmdKey())
|
||||
copy(cmdkeyfl[:], v.users[i].user.Account.(*MemoryAccount).ID.CmdKey())
|
||||
v.aeadDecoderHolder.RemoveUser(cmdkeyfl)
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user