From 140c11a80c3550cb3f63c9ccc02a48cdd07f2441 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 29 Feb 2024 13:00:28 +0100 Subject: [PATCH] (NOBIDS) ratelimit: fix getting from request (#2844) --- ratelimit/ratelimit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ratelimit/ratelimit.go b/ratelimit/ratelimit.go index 70a316bdc2..62c880c272 100644 --- a/ratelimit/ratelimit.go +++ b/ratelimit/ratelimit.go @@ -828,6 +828,10 @@ func getKey(r *http.Request) (key, ip string) { if key != "" { return key, ip } + key = r.Header.Get("apikey") + if key != "" { + return key, ip + } key = r.Header.Get("X-API-KEY") if key != "" { return key, ip