diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-10 05:59:11 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-10 05:59:11 +0000 |
commit | 6434e1e690e757ec8b753133c270e3bbbdaed45f (patch) | |
tree | c8bb3e80a96c3eecd51ecab3b774bbabe8553b95 /lib/webrick/httprequest.rb | |
parent | 073ac4ff5a67570409056971578bb4294649f006 (diff) | |
download | ruby-6434e1e690e757ec8b753133c270e3bbbdaed45f.tar.gz |
* lib/webrick/httprequest.rb (WEBrick::HTTPRequest::parse_uri):
rollup leading slashes. [ruby-core:31657]
patched by Jamison Wilde
NOTE: //authority/path is valid relative URI both RFC2396 and
RFC3986. So when give a relative URI-like string to URI lib,
users must care leading slashes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/httprequest.rb')
-rw-r--r-- | lib/webrick/httprequest.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb index d6cd7d9776..28be9fd790 100644 --- a/lib/webrick/httprequest.rb +++ b/lib/webrick/httprequest.rb @@ -273,6 +273,7 @@ module WEBrick if @config[:Escape8bitURI] str = HTTPUtils::escape8bit(str) end + str.sub!(%r{\A/+}o, '/') uri = URI::parse(str) return uri if uri.absolute? if @forwarded_host |