Skip to content

Commit

Permalink
fix: use KeyByRealIP for rate limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
walkah committed Nov 5, 2024
1 parent d93c821 commit f34856f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/solver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (solverServer *solverServer) ListenAndServe(ctx context.Context, cm *system
subrouter.Use(httprate.Limit(
solverServer.options.RateLimiter.RequestLimit,
time.Duration(solverServer.options.RateLimiter.WindowLength)*time.Second,
httprate.WithKeyFuncs(httprate.KeyByIP, httprate.KeyByEndpoint),
httprate.WithKeyFuncs(httprate.KeyByRealIP, httprate.KeyByEndpoint),
))

subrouter.HandleFunc("/job_offers", http.GetHandler(solverServer.getJobOffers)).Methods("GET")
Expand Down

0 comments on commit f34856f

Please sign in to comment.