mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 22:34:25 +01:00
Block aggressive bots
This commit is contained in:
4
main.go
4
main.go
@@ -159,10 +159,12 @@ func main() {
|
||||
mux.HandleFunc("/{code}", renderEvent)
|
||||
mux.HandleFunc("/{$}", renderHomepage)
|
||||
|
||||
loggedMux := loggingMiddleware(mux)
|
||||
agentMux := agentBlock(loggedMux)
|
||||
|
||||
corsHandler := cors.Default().Handler(
|
||||
http.HandlerFunc(
|
||||
ipblock(loggedMux), // Wrap loggedMux with IP blocking
|
||||
ipblock(agentMux),
|
||||
),
|
||||
)
|
||||
go updateCloudflareRangesRoutine()
|
||||
|
||||
Reference in New Issue
Block a user