Bug #559

WEBrick should use #bytesize instead of #size

Added by lemon (raspberry lemon) over 3 years ago. Updated about 1 year ago.

[ruby-core:18571]
Status:Closed Start date:09/14/2008
Priority:Normal Due date:
Assignee:gotoyuzo (GOTOU Yuuzou) % Done:

100%

Category:lib
Target version:1.9.1 Release Candidate
ruby -v:

Description

Currently, WEBrick uses #size to figure out the content-length headers, which messes up responses with multibyte characters.

The attached patch stupidly replaces all instances of '.size' with '.bytesize'. It fixes the problem and doesn't appear to cause any problems.

patch.diff (10.2 kB) lemon (raspberry lemon), 09/14/2008 02:46 am

Associated revisions

Revision 20152
Added by matz (Yukihiro Matsumoto) over 3 years ago

* lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#do_CONNECT): use #bytesize instead of #size. a patch submitted from raspberry lemon in [ruby-core:18571]. * lib/webrick/httpauth/digestauth.rb, lib/webrick/httpproxy.rb, lib/webrick/httprequest.rb, lib/webrick/httpservlet/cgi_runner.rb, lib/webrick/httpservlet/abstract.rb, lib/webrick/httpresponse.rb, lib/webrick/httpservlet/cgihandler.rb, lib/webrick/utils.rb: ditto.

History

Updated by ko1 (Koichi Sasada) over 3 years ago

  • Assignee set to gotoyuzo (GOTOU Yuuzou)

Updated by yugui (Yuki Sonoda) over 3 years ago

  • Target version set to 1.9.1 Release Candidate

Updated by matz (Yukihiro Matsumoto) over 3 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
Applied in changeset r20152.

Also available in: Atom PDF