Bug #10147

URI parsing with ruby 2.2.0dev

Added by Dieter Späth about 1 year ago. Updated about 1 year ago.

[ruby-core:64443]
Status:Open
Priority:Normal
Assignee:-
ruby -v:ruby 2.2.0dev (2014-08-18 trunk 47214) [x86_64-darwin13] Backport:2.0.0: UNKNOWN, 2.1: UNKNOWN

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

History

#1 Updated by Ahmad Sherif about 1 year 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

Also available in: Atom PDF