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 | |
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
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | lib/webrick/httprequest.rb | 1 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,12 @@ +Tue Aug 10 14:09:31 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * 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. + Tue Aug 10 11:26:33 2010 NAKAMURA Usaku <usa@ruby-lang.org> * lib/un.rb (httpd): SIGQUIT and SIGHUP are not guaranteed to exist. 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 |