Skip to content

Commit

Permalink
Update backend/pkg/commons/ratelimit/ratelimit.go
Browse files Browse the repository at this point in the history
Co-authored-by: Lucca <[email protected]>
  • Loading branch information
guybrush and LuccaBitfly authored Jul 31, 2024
1 parent f599336 commit faaa65f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions backend/pkg/commons/ratelimit/ratelimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -944,10 +944,7 @@ func getRoute(r *http.Request) string {

// getIP returns the ip address from the http request
func getIP(r *http.Request) string {
ips := r.Header.Get("CF-Connecting-IP")
if ips == "" {
ips = r.Header.Get("X-Forwarded-For")
}
ips := cmp.Or(r.Header.Get("CF-Connecting-IP"), r.Header.Get("X-Forwarded-For"))
splitIps := strings.Split(ips, ",")

if len(splitIps) > 0 {
Expand Down

0 comments on commit faaa65f

Please sign in to comment.