From 29bd3564650010264604d60067f714ba38c1fde5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Wysoki=C5=84ski?= Date: Fri, 12 May 2023 08:09:49 +0200 Subject: [PATCH] refactor: remove redundant http.CanonicalHeaderKey --- README.md | 2 +- client_ip_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 672cb1a..c85c5ba 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ import ( ) func main() { - stratXForwardedFor, err := realclientip.NewRightmostNonPrivateStrategy(http.CanonicalHeaderKey("X-Forwarded-For")) + stratXForwardedFor, err := realclientip.NewRightmostNonPrivateStrategy("X-Forwarded-For") if err != nil { log.Fatalln("realclientip.NewRightmostNonPrivateStrategy", err) } diff --git a/client_ip_test.go b/client_ip_test.go index cd132af..82f5740 100644 --- a/client_ip_test.go +++ b/client_ip_test.go @@ -26,7 +26,7 @@ func TestClientIP(t *testing.T) { name: "OK: X-Forwarded-For", strategy: func(t *testing.T) realclientip.Strategy { t.Helper() - strategy, err := realclientip.NewRightmostNonPrivateStrategy(http.CanonicalHeaderKey("X-Forwarded-For")) + strategy, err := realclientip.NewRightmostNonPrivateStrategy("X-Forwarded-For") require.NoError(t, err) return strategy }, @@ -41,7 +41,7 @@ func TestClientIP(t *testing.T) { name: "OK: X-Forwarded-For, RemoteAddr", strategy: func(t *testing.T) realclientip.Strategy { t.Helper() - stratXForwardedFor, err := realclientip.NewRightmostNonPrivateStrategy(http.CanonicalHeaderKey("X-Forwarded-For")) + stratXForwardedFor, err := realclientip.NewRightmostNonPrivateStrategy("X-Forwarded-For") require.NoError(t, err) return realclientip.NewChainStrategy( stratXForwardedFor,