Project

General

Profile

Feature #4551 ยป uri.rb.scheme_downcase.patch

drbrain (Eric Hodel), 04/04/2011 07:35 AM

View differences:

test/uri/test_generic.rb (working copy)
696 696
    assert_raise(URI::InvalidURIError) { uri.query = 'bar' }
697 697
  end
698 698

  
699
  def test_set_scheme
700
    uri = URI.parse 'HTTP://example'
701

  
702
    assert_equal 'http://example', uri.to_s
703
  end
704

  
699 705
  def test_ipv6
700 706
    assert_equal("[::1]", URI("http://[::1]/bar/baz").host)
701 707
    assert_equal("::1", URI("http://[::1]/bar/baz").hostname)
lib/uri/generic.rb (working copy)
272 272
    private :check_scheme
273 273

  
274 274
    def set_scheme(v)
275
      @scheme = v
275
      @scheme = v ? v.downcase : v
276 276
    end
277 277
    protected :set_scheme
278 278