config.go 217 B

12345678910111213
  1. package http
  2. func (sc *ServerConfig) HasAccount(username, password string) bool {
  3. if sc.Accounts == nil {
  4. return false
  5. }
  6. p, found := sc.Accounts[username]
  7. if !found {
  8. return false
  9. }
  10. return p == password
  11. }