From a9fa99940cd6d6f8572f83d6489d402c09b0cf93 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 23 Apr 2009 20:59:39 -0700 Subject: http_response: just barely faster --- lib/unicorn/http_response.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb index 6b6fa07..658184b 100644 --- a/lib/unicorn/http_response.rb +++ b/lib/unicorn/http_response.rb @@ -25,13 +25,13 @@ module Unicorn # Connection: and Date: headers no matter what (if anything) our # Rack application sent us. SKIP = { 'connection' => true, 'date' => true, 'status' => true }.freeze - HEADER_OUT = [ "Connection: close" ] # :nodoc + CONNECTION_CLOSE = "Connection: close".freeze #:nodoc # writes the rack_response to socket as an HTTP response def self.write(socket, rack_response) status, headers, body = rack_response status = "#{status} #{HTTP_STATUS_CODES[status]}" - out = HEADER_OUT.dup # shallow copy + out = [ CONNECTION_CLOSE ] # Don't bother enforcing duplicate supression, it's a Hash most of # the time anyways so just hope our app knows what it's doing -- cgit v1.2.3-24-ge0c7