rework to lighten the main, refactor wrappers. Rehandle csrf and pull config items.
This commit is contained in:
@@ -8,14 +8,16 @@ import (
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"synlotto-website/helpers"
|
||||
"synlotto-website/middleware"
|
||||
"synlotto-website/models"
|
||||
)
|
||||
|
||||
func ResultsThunderball(db *sql.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
ip, _, _ := net.SplitHostPort(r.RemoteAddr)
|
||||
limiter := helpers.GetVisitorLimiter(ip)
|
||||
limiter := middleware.GetVisitorLimiter(ip)
|
||||
|
||||
if !limiter.Allow() {
|
||||
http.Error(w, "Rate limit exceeded", http.StatusTooManyRequests)
|
||||
|
||||
Reference in New Issue
Block a user