From d4fd801ceebf56fe9204a3b2829138fb4c433d39 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 3 Sep 2009 10:55:11 -0700 Subject: Support HTTP/0.9 entity-body-only responses HTTP/0.9 GET requests expect responses without headers. Some weird applications/tools still use the ancient HTTP/0.9 protocol for weird reasons, so we'll support them. ref: rfc 1945, section 4.1 --- lib/unicorn.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/unicorn.rb') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index b185b25..88391f6 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -447,8 +447,7 @@ module Unicorn env.delete(Const::HTTP_EXPECT) response = app.call(env) end - - HttpResponse.write(client, response) + HttpResponse.write(client, response, HttpRequest::PARSER.headers?) # if we get any error, try to write something back to the client # assuming we haven't closed the socket, but don't get hung up # if the socket is already closed or broken. We'll always ensure -- cgit v1.2.3-24-ge0c7