Closed
Description
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/ / / / / / / / / / / / / / / / / /
Please use forum https://forum.labstack.com to ask questions!
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/ / / / / / / / / / / / / / / / / /
Issue Description
Checklist
- Dependencies installed
- No typos
- Searched existing issues and docs
Expected behaviour
rewrite middleware should rewrite the url as configured
Actual behaviour
it returns a 404
Steps to reproduce
- get the latest version of echo (at least commit 7f44549)
Working code to debug
package main
import (
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
)
func main() {
e := echo.New()
e.Pre(middleware.RewriteWithConfig(middleware.RewriteConfig{
Rules: map[string]string{
"/old": "/new",
"/api/*": "/$1",
"/js/*": "/public/javascripts/$1",
"/users/*/orders/*": "/user/$1/order/$2",
},
}))
e.GET("/users", func(c echo.Context) error {
return c.String(200, "Yeah")
})
e.Logger.Fatal(e.Start(":8080"))
}
and than a curl :
curl localhost:8080/api/users
this returns a 404
When running this program with commit f4dde46 it works as expected.
Version/commit
Metadata
Metadata
Assignees
Labels
No labels