From dd281fa6259f2f44bd5dfc1356afeb821675cf1e Mon Sep 17 00:00:00 2001 From: "Mads R. Havmand" Date: Sat, 9 Dec 2023 12:08:39 +0100 Subject: [PATCH] force lowercase when checking header --- interceptors/realip/realip.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interceptors/realip/realip.go b/interceptors/realip/realip.go index bc9350964..8d5a0214e 100644 --- a/interceptors/realip/realip.go +++ b/interceptors/realip/realip.go @@ -58,11 +58,11 @@ func getHeader(ctx context.Context, key string) string { return "" } - if md[key] == nil { + if md[strings.ToLower(key)] == nil { return "" } - return md[key][0] + return md[strings.ToLower(key)][0] } func ipFromHeaders(ctx context.Context, headers []string) netip.Addr {