1
0
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:
Vishal Rana
2015-10-06 06:48:33 -07:00
parent 1efe837fdd
commit 5b019c507e
6 changed files with 121 additions and 145 deletions

@ -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)