about summary refs log tree commit homepage
path: root/lib/yahns/http_client.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-01-04 11:41:30 +0000
committerEric Wong <e@80x24.org>2016-01-04 11:41:30 +0000
commite502a8e21e597895ccb6508b35af1d975c33aeb0 (patch)
treee69f6be27aae51a93773710e09f432736769a16c /lib/yahns/http_client.rb
parent6ea85b061e650cfe348ece306a13d568559fb844 (diff)
downloadyahns-e502a8e21e597895ccb6508b35af1d975c33aeb0.tar.gz
Apparently, StringIO#binmode has been totally broken in 1.9+ and
I've always hidden this bug with the combination of an explicit
string and magic "encoding: binary" comments :x

ref: https://bugs.ruby-lang.org/issues/11945
Diffstat (limited to 'lib/yahns/http_client.rb')
-rw-r--r--lib/yahns/http_client.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb
index 109b545..c300742 100644
--- a/lib/yahns/http_client.rb
+++ b/lib/yahns/http_client.rb
@@ -3,7 +3,7 @@
 # License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
 # frozen_string_literal: true
 class Yahns::HttpClient < Kgio::Socket # :nodoc:
-  NULL_IO = StringIO.new.binmode # :nodoc:
+  NULL_IO = StringIO.new(''.dup) # :nodoc:
 
   include Yahns::HttpResponse
   QEV_FLAGS = Yahns::Queue::QEV_RD # used by acceptor