diff --git a/echo.go b/echo.go index c8520498e..01774efa5 100644 --- a/echo.go +++ b/echo.go @@ -185,7 +185,6 @@ const ( // RouteAny is a special method type that matches any HTTP method in request. Any has lower // priority that other methods that have been registered with Router to that path. RouteAny = "echo_route_any" - ) // Headers @@ -396,6 +395,7 @@ func New() *Echo { Binder: &DefaultBinder{}, JSONSerializer: &DefaultJSONSerializer{}, formParseMaxMemory: defaultMemory, + IPExtractor: LegacyIPExtractor(), } e.serveHTTPFunc = e.serveHTTP diff --git a/echo_test.go b/echo_test.go index 7d2266c13..d3ba55012 100644 --- a/echo_test.go +++ b/echo_test.go @@ -82,6 +82,12 @@ func TestNewWithConfig(t *testing.T) { assert.Equal(t, `Hello, World!`, rec.Body.String()) } +func TestNew(t *testing.T) { + e := New() + + assert.IsType(t, e.IPExtractor, LegacyIPExtractor()) +} + func TestNewDefaultFS(t *testing.T) { tempDir := t.TempDir() filename := filepath.Join(tempDir, "file.txt")