diff options
-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 |