Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 26839 invoked from network); 23 Feb 2009 21:26:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Feb 2009 21:26:32 -0000 Received: (qmail 17680 invoked by uid 500); 23 Feb 2009 21:26:28 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 17642 invoked by uid 500); 23 Feb 2009 21:26:28 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 17609 invoked by uid 99); 23 Feb 2009 21:26:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Feb 2009 13:26:28 -0800 X-ASF-Spam-Status: No, hits=-1997.6 required=10.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,URIBL_RHS_DOB,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Feb 2009 21:26:22 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 582B6234C4AC for ; Mon, 23 Feb 2009 13:26:02 -0800 (PST) Message-ID: <544525726.1235424362360.JavaMail.jira@brutus> Date: Mon, 23 Feb 2009 13:26:02 -0800 (PST) From: "Jens Alfke (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-265) HEAD requests get a Content-Length header In-Reply-To: <1798883270.1235424002881.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676072#action_12676072 ] Jens Alfke commented on COUCHDB-265: ------------------------------------ No, HEAD is supposed to return _exactly the same headers_ as GET, just without the body. It can be used by clients to determine the size of a resource before downloading it, so the Content-Length is definitely useful. > HEAD requests get a Content-Length header > ----------------------------------------- > > Key: COUCHDB-265 > URL: https://issues.apache.org/jira/browse/COUCHDB-265 > Project: CouchDB > Issue Type: Bug > Components: HTTP Interface > Affects Versions: 0.9 > Environment: curl + trunk > Reporter: Paul Joseph Davis > > Looks like HEAD requests are returning a bogus Content-Length header. If I remember my HTTP spec correctly, HEAD requests are supposed to return no Content-Length or a Content-Length of 0 but I could be wrong on that. Either way, it confuses the crap out of curl: > $ curl -X HEAD -i http://127.0.0.1:5984/ > HTTP/1.1 200 OK > Server: CouchDB/0.9.0a (Erlang OTP/R12B) > Date: Mon, 23 Feb 2009 20:56:55 GMT > Content-Type: text/plain;charset=utf-8 > Content-Length: 40 > Cache-Control: must-revalidate > curl: (18) transfer closed with 40 bytes remaining to read > Also, I just happened to be reading couch_http.erl the other day and I remember seeing a note that said mochiweb automatically strips bodies so internally HEAD requests are treated like a GET and mochiweb I guess just doesn't send a body. That's probably important. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.