full coverage for clientip.go

This commit is contained in:
Benjamin Elder 2022-04-19 20:06:13 -07:00
parent e7999a91bb
commit 83c239ff62
1 changed files with 7 additions and 0 deletions

View File

@ -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{