diff --git a/base/web/basic.go b/base/web/basic.go index 84761680..303218e3 100644 --- a/base/web/basic.go +++ b/base/web/basic.go @@ -37,8 +37,8 @@ func BasicCheck(m *ice.Message, realm string) bool { switch ls := kit.Split(m.R.Header.Get(html.Authorization)); kit.Select("", ls, 0) { case html.Basic: if buf, err := base64.StdEncoding.DecodeString(kit.Select("", ls, 1)); !m.Warn(err) { - if ls := strings.SplitN(string(buf), ":", 2); !m.Warn(len(ls) < 2) { - if msg := m.Cmd(TOKEN, ls[1]); !m.Warn(msg.Time() > msg.Append(mdb.TIME)) { + if ls := strings.SplitN(string(buf), ":", 2); !m.Warn(len(ls) < 2 || ls[1] == "", ice.ErrNotValid, html.Basic) { + if msg := m.Cmd(TOKEN, ls[1]); !m.Warn(msg.Time() > msg.Append(mdb.TIME), ice.ErrNotValid) { return true } }