diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 2428788..bf57c6b 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -60,6 +60,15 @@ func (h *CaptchaHandlers) Solve(w http.ResponseWriter, r *http.Request) { func (h *CaptchaHandlers) IsSolved(w http.ResponseWriter, r *http.Request) { captchaID := pcaptcha.ID(server.GetURLParam(r, "captcha")) + isJustRemove := r.URL.Query().Has("remove") + + if isJustRemove { + err := captcha.Remove(captchaID) + if err != nil { + w.WriteHeader(http.StatusNotFound) + } + return + } solved, err := captcha.IsSolved(captchaID) if err != nil {