From 80d3cc6b7512e487bcf58daf497e6b5206216818 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Sun, 24 May 2015 15:28:58 +0200 Subject: [PATCH] Adds test for single IP in X-Forwarded-For --- context_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/context_test.go b/context_test.go index 3cfde113..7c9e0c7f 100644 --- a/context_test.go +++ b/context_test.go @@ -408,6 +408,8 @@ func TestContextClientIP(t *testing.T) { assert.Equal(t, c.ClientIP(), "10.10.10.10") c.Request.Header.Del("X-Real-IP") assert.Equal(t, c.ClientIP(), "20.20.20.20") + c.Request.Header.Set("X-Forwarded-For", "30.30.30.30") + assert.Equal(t, c.ClientIP(), "30.30.30.30") c.Request.Header.Del("X-Forwarded-For") assert.Equal(t, c.ClientIP(), "40.40.40.40") }