We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Router object does not allow custom HTTP methods like COPY or anything else.
COPY
func (n *node) addHandler(method string, h HandlerFunc) and func (n *node) findHandler(method string) HandlerFunc have static switch cases.
func (n *node) addHandler(method string, h HandlerFunc)
func (n *node) findHandler(method string) HandlerFunc
I know this is not a common use case.
Calls the handler defined by:
e.Add("COPY", "/*", func(c echo.Context) error { return c.NoContent(http.StatusCreated) })
It returns echo.NotFoundHandler or echo.MethodNotAllowedHandler.
echo.NotFoundHandler
echo.MethodNotAllowedHandler
package main import ( "fmt" "net/http" "net/http/httputil" "time" "github.com/labstack/echo/v4" ) func main() { e := echo.New() e.Add("COPY", "/*", func(c echo.Context) error { return c.NoContent(http.StatusCreated) }) fmt.Println("Routes:") for _, route := range e.Routes() { fmt.Printf("%6s %s\n", route.Method, route.Path) } go func() { err := e.Start("localhost:5000") if err != nil { panic(err) } }() time.Sleep(time.Second) fmt.Println() // // // req, err := http.NewRequest("COPY", "http://localhost:5000/somepath", nil) if err != nil { panic(err) } payload, err := httputil.DumpRequest(req, false) if err != nil { panic(err) } fmt.Println(string(payload)) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } payload, err = httputil.DumpResponse(resp, true) if err != nil { panic(err) } fmt.Println(string(payload)) }
4.5.0
The text was updated successfully, but these errors were encountered:
closing, from v4.8.0 this is possible. See #2237
Sorry, something went wrong.
No branches or pull requests
Issue Description
The Router object does not allow custom HTTP methods like
COPY
or anything else.func (n *node) addHandler(method string, h HandlerFunc)
andfunc (n *node) findHandler(method string) HandlerFunc
have static switch cases.I know this is not a common use case.
Checklist
Expected behaviour
Calls the handler defined by:
Actual behaviour
It returns
echo.NotFoundHandler
orecho.MethodNotAllowedHandler
.Steps to reproduce
Working code to debug
Version/commit
4.5.0
The text was updated successfully, but these errors were encountered: