mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 22:32:26 +08:00
chore(engine): remove unused lookupHost
This commit is contained in:
parent
c9ea8ece4a
commit
39b372f163
@ -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
|
||||
|
3
gin.go
3
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);",
|
||||
|
Loading…
x
Reference in New Issue
Block a user