Martti T.

Results 364 comments of Martti T.

could you explain why this case should act as no-op instead of panic? most of the cases I think providing nil for these value should be considered as something going...

I really do not want to accept this behavior. Probably just doing this is better ```go if handler == nil { panic("can not add route with nil handler") } ```...

Could you explain why and when this is useful?

This is little bit tricky. Let assume group and handler is added like this: ```go func main() { e := echo.New() g := e.Group("/api/test") //g.Use(middleware.Logger()) g.Any("*", func(c echo.Context) error {...

Sending responses in Echo is 1 method call on context ala `c.JSON(http.StatusOK, data)`. If you create utility method for sending yaml response it will be same. ```go func Yaml(c echo.Context,...

Hi, sorry for late reply but I think problem is not with router. You example is missing `origin` header. CORS [preflight](https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request) request must have origin header. If there would be...

but I do admit that `Access-Control-Allow-Methods: GET,HEAD,PUT,PATCH,POST,DELETE` means that router actually matches `404` route `/api/*` that is being added with `api := e.Group("/api", nil)` line. that last `nil` makes it...

I'm quite sure this caused by hidden routes that group middlewares add. This is very old hack to make sure that group middlewares are applied to 404 cases. Which we...

Please check your server logs if that request is actually sent as POST? Status code 405 hints that OPTIONS method is being used. or maybe you could create working example....

Please try to recreate that situation with that example and add appropriate curl so that I can test this out.