mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-31 05:15:23 -05:00
basic auth in http server
This commit is contained in:
@@ -1 +1,13 @@
|
||||
package http
|
||||
|
||||
func (sc *ServerConfig) HasAccount(username, password string) bool {
|
||||
if sc.Accounts == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
p, found := sc.Accounts[username]
|
||||
if !found {
|
||||
return false
|
||||
}
|
||||
return p == password
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user