1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-10-04 17:33:21 +08:00

Add cookie to prevent captcha constantly

This commit is contained in:
Marcos Lilljedahl
2017-03-14 14:08:46 -03:00
parent 0770eb689b
commit a875bbe23e
4 changed files with 41 additions and 7 deletions

View File

@@ -17,10 +17,9 @@ type NewSessionResponse struct {
func NewSession(rw http.ResponseWriter, req *http.Request) {
req.ParseForm()
if !services.IsHuman(req) {
if !services.IsHuman(req, rw) {
// User it not a human
rw.WriteHeader(http.StatusConflict)
rw.Write([]byte("Only humans are allowed!"))
http.Redirect(rw, req, "/", http.StatusFound)
return
}