diff --git a/ChangeLog b/ChangeLog index 7a93b6ef65..4a275c0090 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Aug 10 14:09:31 2010 NARUSE, Yui + + * 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 * 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