From: "naruse (Yui NARUSE)" Date: 2013-05-03T16:56:05+09:00 Subject: [ruby-core:54757] [ruby-trunk - Bug #8330][Rejected] WEBrick::HTTPUtils::parse_query replaces plus (+) with space Issue #8330 has been updated by naruse (Yui NARUSE). Status changed from Open to Rejected WEBrick::HTTPUtils::parse_query decodes application/x-www-form-urlencoded; it's encodes " " as "+". see also http://url.spec.whatwg.org/#application/x-www-form-urlencoded ---------------------------------------- Bug #8330: WEBrick::HTTPUtils::parse_query replaces plus (+) with space https://bugs.ruby-lang.org/issues/8330#change-39102 Author: cdwertmann (Christoph Dwertmann) Status: Rejected Priority: Normal Assignee: ayumin (Ayumu AIZAWA) Category: lib Target version: ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN According to RFC1738, the plus character (+) is a reserved character and may be used unencoded within a URL. Webrick however replaces plus signs with spaces, which violates the spec and causes a loss of information. An encoded plus character (%2B) is correctly decoded by Webrick. This bug affects Ruby 1.8, 1.9 and 2.0. $ irb irb(main):001:0> require "webrick" => true irb(main):002:0> WEBrick::HTTPUtils::parse_query("a+b c") => {"a b c"=>""} irb(main):003:0> WEBrick::HTTPUtils::parse_query("a%2Bb%20c") => {"a+b c"=>""} irb(main):004:0> ^D -- http://bugs.ruby-lang.org/