Trimming whitespace in XFF for IP whitelisting

This commit is contained in:
Oliver Moser 2018-10-03 22:52:02 +02:00 committed by Traefiker Bot
parent 4cb1ae4626
commit 44e06a1a1e
2 changed files with 4 additions and 3 deletions

View file

@ -32,7 +32,7 @@ func TestIsAuthorized(t *testing.T) {
whiteList: []string{"1.2.3.4/24"},
allowXForwardedFor: true,
remoteAddr: "10.2.3.1:123",
xForwardedForValues: []string{"1.2.3.1, 10.2.3.1"},
xForwardedForValues: []string{"10.2.3.1, 1.2.3.1"},
authorized: true,
},
{