@@ 24,12 24,14 @@ func FormHandler(w http.ResponseWriter, r *http.Request) {
}
_ = r.ParseForm()
sanitizedForm := sanitizeForm(&r.PostForm)
- go func() {
- if !isBot(sanitizedForm) {
- sendForm(sanitizedForm)
- }
- }()
- sendResponse(sanitizedForm, w)
+ if !isBot(sanitizedForm) {
+ sendForm(sanitizedForm)
+ sendResponse(sanitizedForm, w)
+ } else {
+ w.WriteHeader(http.StatusForbidden)
+ _, _ = w.Write([]byte("Your message could not be sent, did you answer the control question correctly? Press the back button and try again. / Uw bericht kon niet verstuurd worden. Heeft u de controlevraag juist beantwoord? Klik terug en probeer opnieuw."))
+ return
+ }
return
}