Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1E556AAC for ; Thu, 21 Jul 2011 04:38:23 +0000 (UTC) Received: (qmail 66450 invoked by uid 500); 21 Jul 2011 04:38:12 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 65008 invoked by uid 500); 21 Jul 2011 04:37:37 -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 64181 invoked by uid 99); 21 Jul 2011 04:37:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 04:37:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of travis.jensen@gmail.com designates 209.85.210.48 as permitted sender) Received: from [209.85.210.48] (HELO mail-pz0-f48.google.com) (209.85.210.48) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 04:37:22 +0000 Received: by pzk32 with SMTP id 32so1610741pzk.7 for ; Wed, 20 Jul 2011 21:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=uEi6OAxoy4tFlEJnkFIWWivUwUZnFrNBrHbgKEVN0ks=; b=Hw9G9kXp3UfIadKKSuHPR880Am1jU9x+B5XSZ4Hf9DTnJwERym4J3TB+MtiE3KWTw9 ozAIiauWaIFkoIbnJeQxO39tlSs1cX0JEq7n7q6OK9N443Q8jJhFuGFddInrjQ6nJygk Af1uJVlzvQECZ8AZvYqrRvrlEyyI5OwfSyxIs= Received: by 10.68.65.233 with SMTP id a9mr12251485pbt.187.1311223022084; Wed, 20 Jul 2011 21:37:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.56.200 with HTTP; Wed, 20 Jul 2011 21:36:32 -0700 (PDT) In-Reply-To: References: From: Travis Jensen Date: Wed, 20 Jul 2011 22:36:32 -0600 Message-ID: Subject: Re: Confused handling of HEAD requests To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=bcaec543110e73e33f04a88ce693 --bcaec543110e73e33f04a88ce693 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jul 20, 2011 at 4:15 PM, Randall Leeds wrote: > > I don't like an "is actually a HEAD request" flag. > Adding HEAD handlers is the right approach, but if we want to be lazy > we could support a fallback to GET when we get a function_clause error > trying to call the handler. > > Unfortunately, that won't work. Most handlers have a clause that looks like this: db_req(#httpd{path_parts=[_DbName]}=Req, _Db) -> send_method_not_allowed(Req, "DELETE,GET,HEAD,POST"); that will catch that inappropriate HEAD request. I guess send_method_not_allowed/2 could be modified to test if HEAD is in the list and throw an error. I'll dig into the archives and see if I can find the previous discussion on the topic. I might have to put an uber-ugly hack in for my use in the meantime. I don't mind spending time doing the "right" thing as long as I know what the "right" thing is. tj -- *Travis Jensen* *** *Read the Software Maven @ http://softwaremaven.innerbrane.com/ Read my LinkedIn profile @ http://www.linkedin.com/in/travisjensen Read my Twitter mumblings @ http://twitter.com/SoftwareMaven Send me email @ travis.jensen@gmail.com **What kind of guy calls himself the Software Maven???** --bcaec543110e73e33f04a88ce693--