mirror of
https://github.com/jeremyd/ergo.git
synced 2026-04-29 08:59:59 -07:00
review fixes; add submatch support to glob
This commit is contained in:
@@ -190,8 +190,18 @@ func TestXForwardedFor(t *testing.T) {
|
||||
checkXFF("10.0.0.4:28432", "10.0.0.3", "10.0.0.3", t)
|
||||
|
||||
checkXFF("10.0.0.4:28432", "1.1.1.1, 8.8.4.4", "8.8.4.4", t)
|
||||
checkXFF("10.0.0.4:28432", "1.1.1.1,8.8.4.4", "8.8.4.4", t)
|
||||
checkXFF("10.0.0.4:28432", "8.8.4.4, 1.1.1.1, 10.0.0.3", "1.1.1.1", t)
|
||||
checkXFF("10.0.0.4:28432", "10.0.0.1, 10.0.0.2, 10.0.0.3", "10.0.0.1", t)
|
||||
checkXFF("10.0.0.4:28432", "10.0.0.1, 10.0.0.2,10.0.0.3", "10.0.0.1", t)
|
||||
|
||||
checkXFF("@", "8.8.4.4, 1.1.1.1, 10.0.0.3", "1.1.1.1", t)
|
||||
|
||||
// invalid IP tests:
|
||||
checkXFF("8.8.4.4:9999", "not_an_ip", "8.8.4.4", t)
|
||||
checkXFF("10.0.0.4:28432", "not_an_ip", "10.0.0.4", t)
|
||||
checkXFF("10.0.0.4:28432", "not_an_ip, 1.1.1.1, 10.0.0.3", "1.1.1.1", t)
|
||||
|
||||
checkXFF("10.0.0.4:28432", "8.8.4.4, not_an_ip, 10.0.0.3", "10.0.0.3", t)
|
||||
checkXFF("10.0.0.4:28432", "8.8.4.4, not_an_ip", "10.0.0.4", t)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user