Skip to content

Commit

Permalink
* lib/net/http.rb (Net::HTTPRequest#send_request_body_data):
Browse files Browse the repository at this point in the history
  set binmode to tempfile.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Dec 14, 2010
1 parent b33cb3c commit cba0d62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Tue Dec 14 13:04:16 2010 NARUSE, Yui <[email protected]>

* lib/net/http.rb (Net::HTTPRequest#send_request_body_data):
set binmode to tempfile.

Tue Dec 14 12:55:46 2010 NAKAMURA Usaku <[email protected]>

* test/zlib/test_zlib.rb (*): should close files associated with zlib.
Expand Down
1 change: 1 addition & 0 deletions lib/net/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,7 @@ def send_request_with_body_data(sock, ver, path, params)
else
require 'tempfile'
file = Tempfile.new('multipart')
file.binmode
encode_multipart_form_data(file, params, opt)
file.rewind
self.content_length = file.size
Expand Down
1 change: 1 addition & 0 deletions test/net/http/test_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ def _test_set_form_multipart(http, chunked_p, data, expected)
def test_set_form_with_file
require 'tempfile'
file = Tempfile.new('ruby-test')
file.binmode
file << $test_net_http_data
filename = File.basename(file.to_path)
data = [['file', file]]
Expand Down

0 comments on commit cba0d62

Please sign in to comment.