Skip to content

Commit

Permalink
test: fix net/http test
Browse files Browse the repository at this point in the history
  • Loading branch information
ginokent committed Aug 24, 2023
1 parent 61cf0b0 commit 6d550af
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions net/http/realip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ package httpz_test
import (
"bytes"
"context"
"net"
"net/http"
"net/http/httptest"
"testing"

netz "github.com/kunitsucom/util.go/net"
httpz "github.com/kunitsucom/util.go/net/http"
)

Expand Down Expand Up @@ -36,7 +34,7 @@ func TestNewXRealIPHandler(t *testing.T) {
actualResponse := &httptest.ResponseRecorder{}

middleware := httpz.NewXRealIPHandler(
[]*net.IPNet{netz.PrivateIPAddressClassA},
httpz.DefaultSetRealIPFrom(),
httpz.HeaderXForwardedFor,
true,
httpz.WithClientIPAddressHeader(header),
Expand Down Expand Up @@ -71,7 +69,7 @@ func TestNewXRealIPHandler(t *testing.T) {
actualResponse := &httptest.ResponseRecorder{}

middleware := httpz.NewXRealIPHandler(
[]*net.IPNet{netz.PrivateIPAddressClassA},
httpz.DefaultSetRealIPFrom(),
testHeaderKey,
true,
)
Expand Down Expand Up @@ -103,7 +101,7 @@ func TestNewXRealIPHandler(t *testing.T) {
actualResponse := &httptest.ResponseRecorder{}

middleware := httpz.NewXRealIPHandler(
[]*net.IPNet{netz.PrivateIPAddressClassA},
httpz.DefaultSetRealIPFrom(),
httpz.HeaderXForwardedFor,
true,
)
Expand Down Expand Up @@ -135,7 +133,7 @@ func TestNewXRealIPHandler(t *testing.T) {
actualResponse := &httptest.ResponseRecorder{}

middleware := httpz.NewXRealIPHandler(
[]*net.IPNet{netz.PrivateIPAddressClassA},
httpz.DefaultSetRealIPFrom(),
httpz.HeaderXForwardedFor,
false,
)
Expand Down

0 comments on commit 6d550af

Please sign in to comment.