From 83c239ff6270d7ed5dce44f9bbe5e43286d2e169 Mon Sep 17 00:00:00 2001 From: Benjamin Elder Date: Tue, 19 Apr 2022 20:06:13 -0700 Subject: [PATCH] full coverage for clientip.go --- cmd/archeio/app/clientip_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/archeio/app/clientip_test.go b/cmd/archeio/app/clientip_test.go index 325f7e3..e179a9a 100644 --- a/cmd/archeio/app/clientip_test.go +++ b/cmd/archeio/app/clientip_test.go @@ -36,6 +36,13 @@ func TestGetClientIP(t *testing.T) { }, ExpectedIP: netip.MustParseAddr("127.0.0.1"), }, + { + Name: "NO X-Forwarded-For, somehow bogus RemoteAddr ??? gotta pump code coverage 🤷", + Request: http.Request{ + RemoteAddr: "127.0.0.1asd;lfkj8888", + }, + ExpectError: true, + }, { Name: "X-Forwarded-For without client-supplied", Request: http.Request{