Issue Description
It appears that the file system improvement (#2064) in the latest release v4.7.0 is breaking the backwards compatibility of static routes. Files that are registered with the Static method are no longer served on that route and a 404 is returned. This issue has already been briefly mentioned in the comments of #2064. I'd like to continue the discussion on this issue here and give a short example.
Checklist
Expected behaviour
The Static method should work and files should be served the same as with <=4.6.3. In other words, the minor update should not change the behaviour of the Static method.
Actual behaviour
Static file routes registered with Static are not serving the given files when updating to echo v4.7.0.
Steps to reproduce
- Create a file in the main directory, eg.
index.html
- Run the code below with echo
v4.6.3
curl http://localhost:8080 -v ==> 200 OK
- Run the code with echo
v4.7.0
curl http://localhost:8080 -v ==> 404 Not found
Working code to debug
.
├── go.mod
├── go.sum
├── index.html
└── main.go
// main.go
package main
import (
"github.com/labstack/echo/v4"
)
func main() {
e := echo.New()
e.Static("", "./index.html")
e.Logger.Fatal(e.Start(":8080"))
}
Version/commit
go version go1.17.6 darwin/arm64
echo v4.7.0
Issue Description
It appears that the file system improvement (#2064) in the latest release
v4.7.0is breaking the backwards compatibility of static routes. Files that are registered with theStaticmethod are no longer served on that route and a404is returned. This issue has already been briefly mentioned in the comments of #2064. I'd like to continue the discussion on this issue here and give a short example.Checklist
Expected behaviour
The
Staticmethod should work and files should be served the same as with<=4.6.3. In other words, the minor update should not change the behaviour of theStaticmethod.Actual behaviour
Static file routes registered with
Staticare not serving the given files when updating to echov4.7.0.Steps to reproduce
index.htmlv4.6.3curl http://localhost:8080 -v==>200 OKv4.7.0curl http://localhost:8080 -v==>404 Not foundWorking code to debug
Version/commit
go version go1.17.6 darwin/arm64
echo v4.7.0