mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-25 17:42:44 +00:00
Trim spaces from elements of split XFF string (#459)
* Trim spaces from elements of split XFF string * Adds test to verify that spaces in original XFF header are handled
This commit is contained in:
committed by
GitHub
parent
1c6c07939a
commit
7f0f691ba5
@@ -130,6 +130,19 @@ func TestComputeXFFHeader(t *testing.T) {
|
||||
},
|
||||
result: "1.1.1.1",
|
||||
},
|
||||
{
|
||||
name: "TrimSpaces",
|
||||
remoteAddr: "127.0.0.1:80",
|
||||
origXFFHeader: "1.1.1.1, 10.0.0.1, fe80::, 100.64.0.1, 169.254.0.1",
|
||||
pref: XFFComputePreferences{
|
||||
StripPrivate: true,
|
||||
StripLoopback: true,
|
||||
StripCGNAT: true,
|
||||
StripLLU: true,
|
||||
Flatten: true,
|
||||
},
|
||||
result: "1.1.1.1",
|
||||
},
|
||||
{
|
||||
name: "invalid-ip-port",
|
||||
remoteAddr: "fe80::",
|
||||
|
||||
Reference in New Issue
Block a user