- From: Larry Masinter <masinter@adobe.com>
- Date: Tue, 1 Dec 2009 17:34:54 -0800
- To: Sam Ruby <rubys@intertwingly.net>
- CC: "PUBLIC-IRI@W3.ORG" <PUBLIC-IRI@w3.org>
In RFC 3986, "[" and "]" are not allowed in the 'query' component.
So "scheme://host/people?foo%5B%5D=bar" is valid and
"scheme://host/people?foo[]=bar" is not
The HTML5 document originally allowed [] in query components,
and "patched" them in the "Web Address" fixup.
This got lost in translation. There are two possibilities:
(a) Patch up "[" and "]" in section 7.2 Web Address processing
(b) make "[" and "]" legal in the query part by changing the
BNF to be:
iquery = *( ipchar / iprivate / "/" / "?" / "[" / "]" )
I'm in favor of trying to move as much of 7.2's "patchup"
behavior into the main line of IRIs as possible.
Larry
--
http://larry.masinter.net
==================
In response to:
==================
> For context, Ruby on Rails is built on top of a component called Rack.
> Both can construct what people colloquially call URLs, but do so
> differently. I'm looking for an expert opinion on which way is "right".
> Any thoughts?
Rails
> app.people_path(:foo => ["bar"])
=> "/people?foo%5B%5D=bar"
Rack
> Rack::Utils.build_nested_query(:foo => ["bar"])
=> "foo[]=bar"
- Sam Ruby
Received on Wednesday, 2 December 2009 01:35:28 UTC