チケット #203 が報告されました。 (by Anonymous)

----------------------------------------
Bug #203: net/http sends wrong content-length
http://redmine.ruby-lang.org/issues/show/203

起票者: Anonymous
ステータス: Open
優先度: Normal
担当者: 
カテゴリ: 
Target version: 


String#size returns count of chars, not count of bytes.

It is necessary to use bytesize method.


 Index: lib/net/http.rb
 ===================================================================
 --- lib/net/http.rb     (revision 17614)
 +++ lib/net/http.rb     (working copy)
 @@ -1643,7 +1643,7 @@
      private
 
      def send_request_with_body(sock, ver, path, body)
 -      self.content_length = body.length
 +      self.content_length = body.bytesize
        delete 'Transfer-Encoding'
        supply_default_content_type
        write_header sock, ver, path


----------------------------------------
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account