Compare commits

...

2 Commits

Author SHA1 Message Date
Nurysso
20f8106366
Merge 9b8104279bd32ba9a11da89a0b7aa0cd27aadc43 into 915e4c90d28ec4cffc6eb146e208ab5a65eac772 2025-12-31 09:57:30 +00:00
nurysso
9b8104279b lint error fixed 2025-12-31 15:27:19 +05:30

View File

@ -1181,7 +1181,11 @@ func TestContextClientIPWithMultipleHeaders(t *testing.T) {
func TestContextClientIPWithSingleHeader(t *testing.T) {
engine := New()
engine.SetTrustedProxies([]string{"127.0.0.1"})
if err := engine.SetTrustedProxies([]string{"127.0.0.1"}); err != nil {
t.Fatalf("SetTrustedProxies failed: %v", err)
}
engine.ForwardedByClientIP = true
engine.RemoteIPHeaders = []string{"X-Forwarded-For"}
@ -1195,7 +1199,6 @@ func TestContextClientIPWithSingleHeader(t *testing.T) {
c.engine = engine
clientIP := c.ClientIP()
// Should return 1.2.3.4
expected := "1.2.3.4"
if clientIP != expected {