Project

General

Profile

Actions

Bug #15979

closed

URI.parse does not validate components

Added by singpolyma (Stephen Paul Weber) over 4 years ago. Updated over 4 years ago.

Status:
Rejected
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.


Files

uri-parse-validate-15979.patch (3.42 KB) uri-parse-validate-15979.patch jeremyevans0 (Jeremy Evans), 10/10/2019 10:47 PM
Actions

Also available in: Atom PDF

Like0
Like0