Catch spam bots on my contact form
This commit is contained in:
parent
a1c84fa1e9
commit
f154c55862
|
@ -38,5 +38,11 @@ func (c Contact) Validate() error {
|
||||||
if len(c.Message) == 0 {
|
if len(c.Message) == 0 {
|
||||||
return errors.New("message is required")
|
return errors.New("message is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Spam bot traps.
|
||||||
|
if c.Trap1 != "" || c.Trap2 != "http://" {
|
||||||
|
return errors.New("message can't be delivered")
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user