Project

General

Profile

Actions

Feature #4551

closed

uri.set_scheme should downcase schemes

Added by drbrain (Eric Hodel) almost 13 years ago. Updated almost 12 years ago.

Status:
Closed
Target version:
-
[ruby-core:35606]

Description

=begin
From RFC 2396 section 3.1:

"For resiliency, programs interpreting URI should treat upper case letters as equivalent to lower case in scheme names (e.g., allow 'HTTP' as well as 'http')."

Currently programs using URI for HTTP vs HTTPS protocol check which protocol to use with a comparison like:

http.use_ssl = uri.scheme == 'https'

Since URI does not modify the input scheme this makes the check fragile. For example:

URI.parse('httpS://example').scheme # => "httpS"

Since RFC 2396 allows uppercase letters to be treated like lowercase I think #set_scheme should downcase its value.
=end


Files

uri.rb.scheme_downcase.patch (929 Bytes) uri.rb.scheme_downcase.patch drbrain (Eric Hodel), 04/04/2011 07:35 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0