about summary refs log tree commit homepage
path: root/lib/yahns/http_context.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/http_context.rb')
-rw-r--r--lib/yahns/http_context.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/yahns/http_context.rb b/lib/yahns/http_context.rb
index eabc667..dc1c5d6 100644
--- a/lib/yahns/http_context.rb
+++ b/lib/yahns/http_context.rb
@@ -1,6 +1,7 @@
 # -*- encoding: binary -*-
 # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
+# frozen_string_literal: true
 
 # subclasses of Yahns::HttpClient will class extend this
 
@@ -79,7 +80,7 @@ module Yahns::HttpContext # :nodoc:
 
   def tmpio_for(len, env)
     # short requests are most common
-    return StringIO.new('') if len && len <= @client_body_buffer_size;
+    return StringIO.new.binmode if len && len <= @client_body_buffer_size;
 
     # too big or chunked, unknown length
     tmp = @input_buffer_tmpdir