mirror of
https://github.com/rls-moe/nyx
synced 2024-11-22 22:12:24 +00:00
ignore captcha when creatig new reply
This commit is contained in:
parent
dea4148f4b
commit
6959b2e816
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"github.com/pressly/chi"
|
"github.com/pressly/chi"
|
||||||
"github.com/tidwall/buntdb"
|
"github.com/tidwall/buntdb"
|
||||||
|
"go.rls.moe/nyx/config"
|
||||||
"go.rls.moe/nyx/http/errw"
|
"go.rls.moe/nyx/http/errw"
|
||||||
"go.rls.moe/nyx/http/middle"
|
"go.rls.moe/nyx/http/middle"
|
||||||
"go.rls.moe/nyx/resources"
|
"go.rls.moe/nyx/resources"
|
||||||
@ -24,12 +25,14 @@ func handleNewReply(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !resources.VerifyCaptcha(r) {
|
if middle.GetConfig(r).Captcha.Mode != config.CaptchaDisabled {
|
||||||
http.Redirect(w, r,
|
if !resources.VerifyCaptcha(r) {
|
||||||
fmt.Sprintf("/%s/%s/thread.html?err=wrong_captcha",
|
http.Redirect(w, r,
|
||||||
chi.URLParam(r, "board"), chi.URLParam(r, "thread")),
|
fmt.Sprintf("/%s/%s/thread.html?err=wrong_captcha",
|
||||||
http.StatusSeeOther)
|
chi.URLParam(r, "board"), chi.URLParam(r, "thread")),
|
||||||
return
|
http.StatusSeeOther)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var reply = &resources.Reply{}
|
var reply = &resources.Reply{}
|
||||||
|
Loading…
Reference in New Issue
Block a user