From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: * X-Spam-ASN: AS33070 50.56.128.0/17 X-Spam-Status: No, score=1.3 required=5.0 tests=RDNS_NONE,T_DKIM_INVALID shortcircuit=no autolearn=no version=3.3.2 X-Original-To: archivist@yhbt.net Delivered-To: archivist@dcvr.yhbt.net Received: from rubyforge.org (unknown [50.56.192.79]) by dcvr.yhbt.net (Postfix) with ESMTP id 581B61F433 for ; Thu, 13 Jun 2013 19:07:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 61FEE2E14F; Thu, 13 Jun 2013 19:07:56 +0000 (UTC) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by rubyforge.org (Postfix) with ESMTP id 866FA2E14A for ; Thu, 13 Jun 2013 18:42:50 +0000 (UTC) Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 521E8211D8; Thu, 13 Jun 2013 14:42:44 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 13 Jun 2013 14:42:48 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=titanous.com; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=mesmtp; bh=2jzOqRXZZZFu11iNNPYvQeUwkrw=; b=pzT4btKFClpWIL5w4q7anQkz0Rmc 1LSItu2N+ExSdA0XgGaRqQ7buZdA9Rn3a/lOKGXkN9PgBz8B09iryOQggO+QdBXj 0T+tjjDIyAQgjPUPi0CoXqc+/0vfKB5df8/p2QdAuScUUc4MtqzMVY6uos1sFmni iYZpicqK+rCfnv4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id :references:to; s=smtpout; bh=2jzOqRXZZZFu11iNNPYvQeUwkrw=; b=mi MPQmWE7yJxy13sGtzO7UfYiQzwNM0Rf6yxKjs7YrHBHFe3N8p0+iDx/7d22JsROO Us0j0Kfj692TOguD1n0oq0rl9NLS4f900EvQVTTKkgXSTpozN9j/SNK+osewe4WL 3RKrPQsEDmmNc5DLF55vebP3n1C24yK1qeWzYpDE0= X-Sasl-enc: XK0gaSSV31qZRLWQ6rcAQcF6P5afqXiz9PjQhVE3yAQZ 1371148953 Received: from [10.10.10.124] (unknown [71.185.221.139]) by mail.messagingengine.com (Postfix) with ESMTPA id 36AD168027E; Thu, 13 Jun 2013 14:42:33 -0400 (EDT) Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: HEAD responses contain body From: Jonathan Rudenberg In-Reply-To: <20130613182238.GA11842@dcvr.yhbt.net> Date: Thu, 13 Jun 2013 14:42:32 -0400 Message-Id: <3CDFEE4E-AD32-4C0B-A90A-CEADC003B928@titanous.com> References: <9AEB1922-1C40-4E20-868B-9B890C22905E@titanous.com> <20130613182238.GA11842@dcvr.yhbt.net> To: Eric Wong X-Mailer: Apple Mail (2.1508) Cc: unicorn list , "wrote:"@dcvr.yhbt.net X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org On Jun 13, 2013, at 2:22 PM, Eric Wong wrote: > Jonathan Rudenberg wrote: >> 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' >> > > + use Rack::Head > >> run lambda { |env| [200, {}, []] } > > The Rack::Head middleware should be used to correctly strip HEAD > responses of their bodies (frameworks such as Rails/Sinatra should > already add Rack::Head to the middleware stack for you) This does not change the result, as the Rack::Head implementation looks like this: def call(env) status, headers, body = @app.call(env) if env["REQUEST_METHOD"] == "HEAD" body.close if body.respond_to? :close [status, headers, []] else [status, headers, body] end end >> 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. > > Try using "-d" on the command-line to enable debugging to see what the > error is (and check the logs/stderr output). Exception `Errno::ENOTCONN' at /Users/titanous/.gem/ruby/1.9.3/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:565 - Socket is not connected > Also, what RACK_ENV (or -E/--env) are you using? It could be the > incorrect HEAD response tripping Rack::Lint under development mode. None, specified, I'm booting unicorn with no configuration or flags specified. > >> Please cc any responses directly to me, as I do not subscribe to this list. > > Done :> _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying