Bug #203

net/http sends wrong content-length

Added by Anonymous almost 7 years ago. Updated almost 4 years ago.

Status:Closed
Priority:Normal
Assignee:Minero Aoki
ruby -v: Backport:

Description

=begin
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 =end

Associated revisions

Revision 18518
Added by Minero Aoki over 6 years ago

  • lib/net/http.rb (send_request_with_body): Content-Length should be byte length of string. (closes #203)

Revision 18518
Added by Minero Aoki over 6 years ago

  • lib/net/http.rb (send_request_with_body): Content-Length should be byte length of string. (closes #203)

Revision 47315
Added by tenderlove 7 months ago

  • ext/psych/lib/psych/visitors/to_ruby.rb: quoted "<<" strings should not be treated as merge keys.
  • ext/psych/lib/psych/visitors/yaml_tree.rb: hashes with keys containing "<<" should roundtrip.
  • test/psych/test_merge_keys.rb: test for change. Fixes GH #203

Revision 47315
Added by tenderlove 7 months ago

  • ext/psych/lib/psych/visitors/to_ruby.rb: quoted "<<" strings should not be treated as merge keys.
  • ext/psych/lib/psych/visitors/yaml_tree.rb: hashes with keys containing "<<" should roundtrip.
  • test/psych/test_merge_keys.rb: test for change. Fixes GH #203

History

#1 Updated by Koichi Sasada over 6 years ago

  • Assignee set to Minero Aoki

=begin

=end

#2 Updated by Minero Aoki over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r18518.
=end

Also available in: Atom PDF