summaryrefslogtreecommitdiff
path: root/service/http/handler_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/http/handler_test.go')
-rw-r--r--service/http/handler_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/service/http/handler_test.go b/service/http/handler_test.go
index 64f536bf..e29b76ac 100644
--- a/service/http/handler_test.go
+++ b/service/http/handler_test.go
@@ -1346,6 +1346,14 @@ func TestHandler_XForwardedFor(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, 200, r.StatusCode)
assert.Equal(t, "101.0.0.1", body)
+
+ body, r, err = getHeader("http://127.0.0.1:8177/", map[string]string{
+ "X-Forwarded-For": "100.0.0.1, 200.0.0.1, 101.0.0.1, invalid",
+ })
+
+ assert.NoError(t, err)
+ assert.Equal(t, 200, r.StatusCode)
+ assert.Equal(t, "101.0.0.1", body)
}
func TestHandler_XForwardedFor_NotTrustedRemoteIp(t *testing.T) {