Browse Source

Run form sending in goroutine

pull/1/head
Jan-Lukas Else 4 years ago
parent
commit
96053ce350
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      forms.go

+ 5
- 3
forms.go View File

@ -21,9 +21,11 @@ func FormHandler(w http.ResponseWriter, r *http.Request) {
}
_ = r.ParseForm()
sanitizedForm := sanitizeForm(r.PostForm)
if !isBot(sanitizedForm) {
sendForm(sanitizedForm)
}
go func() {
if !isBot(sanitizedForm) {
sendForm(sanitizedForm)
}
}()
sendResponse(sanitizedForm, w)
return
}


Loading…
Cancel
Save