X-Forwarded-For handler for labstack echo and Fastly
This commit is contained in:
23
xff/fastlyxff/xff_test.go
Normal file
23
xff/fastlyxff/xff_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package fastlyxff
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFastlyIPRanges(t *testing.T) {
|
||||
|
||||
fastlyxff, err := New("fastly.json")
|
||||
if err != nil {
|
||||
t.Fatalf("could not load test data: %s", err)
|
||||
}
|
||||
|
||||
data, err := fastlyxff.EchoTrustOption()
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("could not parse test data: %s", err)
|
||||
}
|
||||
|
||||
if len(data) < 10 {
|
||||
t.Logf("only got %d prefixes, expected more", len(data))
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user