From ff99f2ccba02b5c5c82f6c2aa7ae879fd9363eb9 Mon Sep 17 00:00:00 2001 From: Julien Kirch Date: Mon, 12 Apr 2010 13:22:47 +0200 Subject: [PATCH] use binary mode for payload's temp file. Fixes #117. --- history.md | 1 + lib/restclient/payload.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/history.md b/history.md index f85cb08..4b4350f 100644 --- a/history.md +++ b/history.md @@ -3,6 +3,7 @@ - added Response.to_str and AbstractResponse.to_i to improve semantic and compatibility - multipart Payloads ignores the name attribute if it's not set (patch provided by Tekin Suleyman) - correctly takes into account user headers whose keys are strings (path provided by Cyril Rohr) +- use binary mode for payload temp file # 1.4.2 diff --git a/lib/restclient/payload.rb b/lib/restclient/payload.rb index 197d20b..d97fa92 100644 --- a/lib/restclient/payload.rb +++ b/lib/restclient/payload.rb @@ -116,6 +116,7 @@ module RestClient b = "--#{boundary}" @stream = Tempfile.new("RESTClient.Stream.#{rand(1000)}") + @stream.binmode @stream.write(b + EOL) if params.is_a? Hash