From: Jamison Wilde Date: 2010-08-10T00:24:18+09:00 Subject: [ruby-core:31657] [Bug #3669] Webrick URI parsing problem Bug #3669: Webrick URI parsing problem http://redmine.ruby-lang.org/issues/show/3669 Author: Jamison Wilde Status: Open, Priority: Low Category: lib ruby -v: 1.8.6, 1.8.7, 1.9.1 Webrick doesn't handle server local URI's that begin with two slashes gracefully. This behavior is not seen on other ruby http server implementations. If a local URI has two slashes such as 'http://myserver.com//path/file', the path portion of the URI is lost and webrick tries to locate the file as 'http://myserver.com/file'. The solution is to rollup any leading slashes in webrick/httprequest.rb/#parse_uri. *** lib\ruby\1.9.1\webrick\Copy of httprequest.rb Mon Aug 09 10:18:05 2010 --- lib\ruby\1.9.1\webrick\httprequest.rb Mon Aug 09 10:18:30 2010 *************** module WEBrick *** 273,278 **** --- 273,279 ---- if @config[:Escape8bitURI] str = HTTPUtils::escape8bit(str) end + str.gsub!(%r{^/+}o, '/') uri = URI::parse(str) return uri if uri.absolute? if @forwarded_host ---------------------------------------- http://redmine.ruby-lang.org