mirror of https://github.com/velour/catbase.git
counter: fix bug where anything but the right password worked
This commit is contained in:
parent
df0b5d709b
commit
72c32e1c16
|
@ -205,7 +205,7 @@ func (p *CounterPlugin) handleCounterAPI(w http.ResponseWriter, r *http.Request)
|
||||||
log.Debug().
|
log.Debug().
|
||||||
Interface("postbody", info).
|
Interface("postbody", info).
|
||||||
Msg("Got a POST")
|
Msg("Got a POST")
|
||||||
if p.b.CheckPassword("", info.Password) {
|
if !p.b.CheckPassword("", info.Password) {
|
||||||
w.WriteHeader(http.StatusForbidden)
|
w.WriteHeader(http.StatusForbidden)
|
||||||
j, _ := json.Marshal(struct{ Err string }{Err: "Invalid Password"})
|
j, _ := json.Marshal(struct{ Err string }{Err: "Invalid Password"})
|
||||||
w.Write(j)
|
w.Write(j)
|
||||||
|
|
Loading…
Reference in New Issue