mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 17:44:05 +08:00
fix token
This commit is contained in:
parent
80aa4ce207
commit
6bb29fed18
@ -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) {
|
switch ls := kit.Split(m.R.Header.Get(html.Authorization)); kit.Select("", ls, 0) {
|
||||||
case html.Basic:
|
case html.Basic:
|
||||||
if buf, err := base64.StdEncoding.DecodeString(kit.Select("", ls, 1)); !m.Warn(err) {
|
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 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)) {
|
if msg := m.Cmd(TOKEN, ls[1]); !m.Warn(msg.Time() > msg.Append(mdb.TIME), ice.ErrNotValid) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user