diff --git a/context_test.go b/context_test.go index 16c4dd28..cb1f9c5b 100644 --- a/context_test.go +++ b/context_test.go @@ -1392,19 +1392,6 @@ func TestContextClientIP(t *testing.T) { c, _ := CreateTestContext(httptest.NewRecorder()) c.Request, _ = http.NewRequest("POST", "/", nil) - c.engine.lookupHost = func(host string) ([]string, error) { - if host == "foo" { - return []string{"40.40.40.40", "30.30.30.30"}, nil - } - if host == "bar" { - return nil, errors.New("hostname lookup failed") - } - if host == "baz" { - return []string{"thisshouldneverhappen"}, nil - } - return []string{}, nil - } - resetContextForClientIPTests(c) // Legacy tests (validating that the defaults don't break the diff --git a/gin.go b/gin.go index 877d3238..d20fcfbf 100644 --- a/gin.go +++ b/gin.go @@ -106,8 +106,6 @@ type Engine struct { // See the PR #1817 and issue #1644 RemoveExtraSlash bool - lookupHost func(string) ([]string, error) - delims render.Delims secureJSONPrefix string HTMLRender render.HTMLRender @@ -152,7 +150,6 @@ func New() *Engine { RemoveExtraSlash: false, UnescapePathValues: true, MaxMultipartMemory: defaultMultipartMemory, - lookupHost: net.LookupHost, trees: make(methodTrees, 0, 9), delims: render.Delims{Left: "{{", Right: "}}"}, secureJSONPrefix: "while(1);",