Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -396,6 +395,7 @@ func New() *Echo {
Binder: &DefaultBinder{},
JSONSerializer: &DefaultJSONSerializer{},
formParseMaxMemory: defaultMemory,
IPExtractor: LegacyIPExtractor(),
}

e.serveHTTPFunc = e.serveHTTP
Expand Down
6 changes: 6 additions & 0 deletions echo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down