summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/unicorn/http_response.rb16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb
index cc027c5..c9c2de8 100644
--- a/lib/unicorn/http_response.rb
+++ b/lib/unicorn/http_response.rb
@@ -36,9 +36,9 @@ module Unicorn::HttpResponse
         when %r{\A(?:Date\z|Connection\z)}i
           next
         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)
+          # This should only be hit under Rack >= 1.5, as this was an illegal
+          # key in Rack < 1.5
+          hijack = value
         else
           if value =~ /\n/
             # avoiding blank, key-only cookies with /\n+/
@@ -60,14 +60,4 @@ module Unicorn::HttpResponse
   ensure
     body.respond_to?(:close) and body.close
   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
-  else
-    def hijack_prepare(_)
-    end
-  end
 end