diff options
Diffstat (limited to 'lib/unicorn/http_response.rb')
-rw-r--r-- | lib/unicorn/http_response.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb index b781e20..61563cd 100644 --- a/lib/unicorn/http_response.rb +++ b/lib/unicorn/http_response.rb @@ -18,11 +18,13 @@ module Unicorn::HttpResponse CRLF = "\r\n" # writes the rack_response to socket as an HTTP response - def http_response_write(socket, status, headers, body) + def http_response_write(socket, status, headers, body, + response_start_sent=false) status = CODES[status.to_i] || status + http_response_start = response_start_sent ? '' : 'HTTP/1.1 ' if headers - buf = "HTTP/1.1 #{status}\r\n" \ + buf = "#{http_response_start}#{status}\r\n" \ "Date: #{httpdate}\r\n" \ "Status: #{status}\r\n" \ "Connection: close\r\n" |