Skip to content

Error with ** path matching and path: in From clause #15

@technosophos

Description

@technosophos

Using:

    registry.Route("GET /hello/**", "Print Hello Web").
        Does(web.Flush, "out").
        Using("content").From("query:msg path:2 path:1")

Curl:

$ curl localhost:8080/hello/world
An internal error occurred.

Error:

error2014/06/13 16:21:19 CookooHandler trapped a panic on route 'GET /hello/**' in command 'out': runtime error: index out of range
error2014/06/13 16:21:19 Stack: goroutine 8 [running]:
github.com/Masterminds/cookoo/web.func·001()
    /Users/mbutcher/Code/Cookoo-Web-Tutorial/.godeps/src/github.com/Masterminds/cookoo/web/server.go:162 +0x39a
runtime.panic(0x234100, 0x527c57)
    /usr/local/Cellar/go/1.2/libexec/src/pkg/runtime/panic.c:248 +0x106
github.com/Masterminds/cookoo/web.(*PathDatasource).Value(0xc210048d60, 0x2bd6df, 0x1, 0x628740, 0xc210048d60)
    /Users/mbutcher/Code/Cookoo-Web-Tutorial/.godeps/src/github.com/Masterminds/cookoo/web/datasources.go:111 +0xae
github.com/Masterminds/cookoo.(*Router).defaultFromSources(0xc2100484a0, 0xc210048da0, 0x3, 0x3, 0x6272e0, ...)
    /Users/mbutcher/Code/Cookoo-Web-Tutorial/.godeps/src/github.com/Masterminds/cookoo/router.go:248 +0x284
github.com/Masterminds/cookoo.(*Router).resolveParams(0xc2100484a0, 0xc210037e10, 0x6272e0, 0xc2100a71b0, 0xc)
    /Users/mbutcher/Code/Cookoo-Web-Tutorial/.godeps/src/github.com/Masterminds/cookoo/router.go:217 +0x11f
github.com/Masterminds/cookoo.(*Router).doCommand(0xc2100484a0, 0xc210037e10, 0x6272e0, 0xc2100a71b0, 0xc21000ae20, ...)
    /Users/mbutcher/Code/Cookoo-Web-Tutorial/.godeps/src/github.com/Masterminds/cookoo/router.go:206 +0x4a
github.com/Masterminds/cookoo.(*Router).runRoute(0xc2100484a0, 0x2956d0, 0xd, 0x6272e0, 0xc2100a71b0, ...)
    /Users/mbutcher/Code/Cookoo-Web-Tutorial/.godeps/src/github.com/Masterminds/cookoo/router.go:165 +0x40b
github.com/Masterminds/cookoo.(*Router).HandleRequest(0xc2100484a0, 0xc210048d80, 0x10, 0x6272e0, 0xc2100a71b0, ...)
    /Users/mbutcher/Code/Cookoo-Web-Tutorial/.godeps/src/github.com/Masterminds/cookoo/router.go:132 +0x256
github.com/Masterminds/cookoo/web.(*CookooHandler).ServeHTTP(0xc210048520, 0x628630, 0xc2100a1140, 0xc21009e5b0)
    /Users/mbutcher/Code/Cookoo-Web-Tutorial/.godeps/src/github.com/Masterminds/cookoo/web/server.go:185 +0x35b
net/http.(*ServeMux).ServeHTTP(0xc2100375d0, 0x628630, 0xc2100a1140, 0xc21009e5b0)
    /usr/local/Cellar/go/1.2/libexec/src/pkg/net/http/server.go:1496 +0x163
net/http.serverHandler.ServeHTTP(0xc21001e9b0, 0x628630, 0xc2100a1140, 0xc21009e5b0)
    /usr/local/Cellar/go/1.2/libexec/src/pkg/net/http/server.go:1597 +0x16e
net/http.(*conn).serve(0xc210057780)
    /usr/local/Cellar/go/1.2/libexec/src/pkg/net/http/server.go:1167 +0x7b7
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.2/libexec/src/pkg/net/http/server.go:1644 +0x28b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions