Skip to content

url.parseQuery supporting & but not ";" as separator #2210

Closed
@gopherbot

Description

@gopherbot

by mt4swm:

What steps will reproduce the problem?
1. run godoc -http :6060
2. in a browser, type
     http://127.0.0.1:6060/src/pkg/url/url.go?h=%22%26%22&;s=14652:14657#L534
   This will show url.parseQuery, with "Split" and "&" highlighted.
3. Now, type 
     http://127.0.0.1:6060/src/pkg/url/url.go?h=%22%26%22;s=14652:14657#L534

What is the expected output?

I would expect ";" being accepted as query string value separator, just like
"&".

What do you see instead?

The current implementation of parseQuery seems not to recognize ";",
but it handles "&". Thus the query values `h' and `s' of the second
variant cannot be decoded.

Which revision are you using?  (hg identify)

tip:47d429aad39c

Please provide any additional information below.

Apparently some cgi's and html pages rely on ";" being accepted as a value
separator in query strings, besides "&". There is a recommendation
suggesting this behaviour at
http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2 .

Would a patch addressing this be welcome, or, on the contrary, has ";" been
left out by intention?

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