about summary refs log tree commit homepage
path: root/lib/rainbows/response.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-11-14 02:47:25 +0000
committerEric Wong <e@80x24.org>2015-11-18 02:20:26 +0000
commit1a2a82721bf845a3f7e7a3972bc0f41befb25c41 (patch)
tree98da87ea5d5293b31fa3fd463b6d70b3059a1be3 /lib/rainbows/response.rb
parent70c976bdd85bb8515fea01d6ad6074ef472fc2e0 (diff)
downloadrainbows-1a2a82721bf845a3f7e7a3972bc0f41befb25c41.tar.gz
unicorn lost the hijack_setup method in version 5,
so we must recreate it ourselves.
Diffstat (limited to 'lib/rainbows/response.rb')
-rw-r--r--lib/rainbows/response.rb16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/rainbows/response.rb b/lib/rainbows/response.rb
index 2e8d2d8..0b5e542 100644
--- a/lib/rainbows/response.rb
+++ b/lib/rainbows/response.rb
@@ -15,18 +15,8 @@ module Rainbows::Response
       Rainbows::HttpParser.keepalive_requests = 0
   end
 
-  # Rack 1.5.0 (protocol version 1.2) adds response hijacking support
-  if ((Rack::VERSION[0] << 8) | Rack::VERSION[1]) >= 0x0102
-    def hijack_prepare(value)
-      value
-    end
-
-    def hijack_socket
-      @hp.env['rack.hijack'].call
-    end
-  else
-    def hijack_prepare(_)
-    end
+  def hijack_socket
+    @hp.env['rack.hijack'].call
   end
 
   # returns the original body on success
@@ -45,7 +35,7 @@ module Rainbows::Response
       when "rack.hijack"
         # this was an illegal key in Rack < 1.5, so it should be
         # OK to silently discard it for those older versions
-        hijack = hijack_prepare(value)
+        hijack = value
         alive = false # No persistent connections for hijacking
       else
         if /\n/ =~ value