couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travis Jensen <>
Subject Re: Confused handling of HEAD requests
Date Thu, 21 Jul 2011 04:36:32 GMT
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

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.

*Travis Jensen*
*Read the Software Maven @
Read my LinkedIn profile @
Read my Twitter mumblings @
Send me email @

**What kind of guy calls himself the Software Maven???**

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message