about summary refs log tree commit homepage
path: root/lib/yahns/proxy_http_response.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/proxy_http_response.rb')
-rw-r--r--lib/yahns/proxy_http_response.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/yahns/proxy_http_response.rb b/lib/yahns/proxy_http_response.rb
index 61989c2..50c841d 100644
--- a/lib/yahns/proxy_http_response.rb
+++ b/lib/yahns/proxy_http_response.rb
@@ -64,7 +64,7 @@ module Yahns::HttpResponse # :nodoc:
     msg = Rack::Utils::HTTP_STATUS_CODES[code]
     env = @hs.env
     have_body = !Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include?(code) &&
-                env[REQUEST_METHOD] != HEAD
+                env['REQUEST_METHOD'] != 'HEAD'.freeze
     flags = MSG_DONTWAIT
     alive = @hs.next? && self.class.persistent_connections
     response_headers = env['yahns.proxy_pass.response_headers']
@@ -91,7 +91,8 @@ module Yahns::HttpResponse # :nodoc:
 
     # For now, do not add a Date: header, assume upstream already did it
     # but do not care if they did not
-    res << (alive ? CONN_KA : CONN_CLOSE)
+    res << (alive ? "Connection: keep-alive\r\n\r\n"
+                  : "Connection: close\r\n\r\n")
 
     # send the headers
     case rv = kgio_syssend(res, flags)