Skip to content

Instantly share code, notes, and snippets.

@titanous
Created June 13, 2013 16:16
Show Gist options
  • Save titanous/5775045 to your computer and use it in GitHub Desktop.
Save titanous/5775045 to your computer and use it in GitHub Desktop.
From: Jonathan Rudenberg <[email protected]>
Subject: HEAD responses contain body
Date: Thu, 13 Jun 2013 12:09:43 -0400
To: [email protected]
RFC 2616 section 9.4[1] states:
> The HEAD method is identical to GET except that the server MUST NOT
> return a message-body in the response.
A HEAD request against this simple Rack app running on unicorn-4.6.2:
require 'rack'
run lambda { |env| [200, {}, []] }
Looks like this on the wire:
HEAD / HTTP/1.1
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5
Host: localhost:8080
Accept: */*
HTTP/1.1 200 OK
Date: Thu, 13 Jun 2013 16:04:55 GMT
Status: 200 OK
Connection: close
Transfer-Encoding: chunked
0
HTTP/1.1 500 Internal Server Error
As you can see, not only is there a zero-length chunked encoding body,
but for some unknown reason there is a 500 response with no body as
well.
Please cc any responses directly to me, as I do not subscribe to this
list.
Cheers,
Jonathan
[1] https://tools.ietf.org/html/rfc2616#section-9.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment