Bug #10147
closedURI parsing with ruby 2.2.0dev
Description
Hi,
the following uris can't be parsed any more (ruby: ruby 2.2.0dev (2014-08-18 trunk 47214) [x86_64-darwin13])
`
require 'uri'
URI('//example.org/nested_optional_group?items[][key]=foo')
URI('//example.org/nested_optional_group?items[key]=foo')
URI('//example.org/nested_optional_group?items[]=foo')
`
With ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0] this uris can be parsed.
regards
dieter
Updated by ahmadsherif (Ahmad Sherif) almost 11 years ago
URI module is now using an RFC3986 parser by default (starting r46491), '[' and ']' characters are not allowed in a URI's query per the RFC.
You can still use the old parser (RFC2396) like this
require 'uri'
p = URI::Parser.new
p.parse('//example.org/nested_optional_group?items[][key]=foo')
or you can have a look at this https://gist.github.com/lengarvey/31983eac6664351ed16d
Updated by jeremyevans0 (Jeremy Evans) almost 6 years ago
- Status changed from Open to Closed