X-Forwarded-For handler for labstack echo and Fastly

This commit is contained in:
2023-11-12 15:51:21 -08:00
parent 62e28b71f1
commit 2bff6d8ef3
3 changed files with 75 additions and 0 deletions

23
xff/fastlyxff/xff_test.go Normal file
View 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()
}
}