From: naruse Date: 2012-03-18T19:25:41+09:00 Subject: [ruby-core:43444] [ruby-trunk - Feature #4551][Assigned] uri.set_scheme should downcase schemes Issue #4551 has been updated by naruse. Description updated Status changed from Open to Assigned Assignee set to naruse ---------------------------------------- Feature #4551: uri.set_scheme should downcase schemes https://bugs.ruby-lang.org/issues/4551#change-24911 Author: drbrain Status: Assigned Priority: Normal Assignee: naruse Category: lib Target version: =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 -- http://bugs.ruby-lang.org/