mirror of
https://github.com/labstack/echo.git
synced 2025-06-25 00:47:01 +02:00
Handling 405 & pre-flight requests
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
@ -567,16 +567,6 @@ func TestRouterAPI(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRouterAddInvalidMethod(t *testing.T) {
|
||||
e := New()
|
||||
r := e.router
|
||||
assert.Panics(t, func() {
|
||||
r.Add("INVALID", "/", func(*Context) error {
|
||||
return nil
|
||||
}, e)
|
||||
})
|
||||
}
|
||||
|
||||
func TestRouterServeHTTP(t *testing.T) {
|
||||
e := New()
|
||||
r := e.router
|
||||
@ -600,7 +590,7 @@ func TestRouterServeHTTP(t *testing.T) {
|
||||
|
||||
func (n *node) printTree(pfx string, tail bool) {
|
||||
p := prefix(tail, pfx, "└── ", "├── ")
|
||||
fmt.Printf("%s%s, %p: type=%d, parent=%p, handler=%v\n", p, n.prefix, n, n.typ, n.parent, n.handler)
|
||||
fmt.Printf("%s%s, %p: type=%d, parent=%p, handler=%v\n", p, n.prefix, n, n.typ, n.parent, n.methodHandler)
|
||||
|
||||
children := n.children
|
||||
l := len(children)
|
||||
|
Reference in New Issue
Block a user