Project

General

Profile

Bug #15979

URI.parse does not validate components

Added by singpolyma (Stephen Paul Weber) 19 days ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:93505]

Description

URI.parse("https://-._~%2C!$&'()*+,;=:@-._~%2C!$&'()*+,;=:/foo?/-._~%2C!$&'()*+,;=:@/?")

happily return a URI::HTTPS object, even though it has an invalid component and cannot be constructed using URI::HTTPS.build

This is because the parser uses the undocumented initializer which defaults to not validating the components. I would suggest to send that initializer the flag to allow validation or to use the build method instead from the parser.

Also available in: Atom PDF