Skip to content

Request Params: Query takes precedance over path #1095

@pedromorgan

Description

@pedromorgan

Here's the route

GET /ajax/ags/abbrev/:code     Ags.Abbrev

and controller

func (c Ags) Abbrev(code string) revel.Result {
    fmt.Println("arg=", code)
    fmt.Println("query=", c.Request.URL.Query().Get("code"))
}

and the url + output

http://localhost:9000/ajax/ags/abbrev/CMPG_TYPE?code=CMPG_TYPEsss

GET /ajax/ags/abbrevs
arg= CMPG_TYPEsss
query= CMPG_TYPEsss

Whats scared me is the somehow the ?query is overriding the "path" extraction.

from here its says their "all in one params" http://revel.github.io/manual/parameters.html
which is fair, but is this not dangerous ??

The expected behaviour would be that the "path" part would override the "query part", or am i missing something ??

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions