diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-14 04:05:03 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-14 04:05:03 +0000 |
commit | cba0d62d9119a6722a18b092fab070d4b3946674 (patch) | |
tree | 4d020cfe54496e0c1b566dd1b5e045cfca29da54 | |
parent | b33cb3c017d7891505848dacd3c1e599733bf20b (diff) | |
download | ruby-cba0d62d9119a6722a18b092fab070d4b3946674.tar.gz |
* lib/net/http.rb (Net::HTTPRequest#send_request_body_data):
set binmode to tempfile.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/http.rb | 1 | ||||
-rw-r--r-- | test/net/http/test_http.rb | 1 |
3 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Tue Dec 14 13:04:16 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * lib/net/http.rb (Net::HTTPRequest#send_request_body_data): + set binmode to tempfile. + Tue Dec 14 12:55:46 2010 NAKAMURA Usaku <usa@ruby-lang.org> * test/zlib/test_zlib.rb (*): should close files associated with zlib. diff --git a/lib/net/http.rb b/lib/net/http.rb index 6a86dbaba7..cc0a0b20dc 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1935,6 +1935,7 @@ module Net #:nodoc: else require 'tempfile' file = Tempfile.new('multipart') + file.binmode encode_multipart_form_data(file, params, opt) file.rewind self.content_length = file.size diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index a2ce962573..5e5cdab9ff 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -354,6 +354,7 @@ __EOM__ 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]] |