couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travis Jensen <travis.jen...@gmail.com>
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 <randall.leeds@gmail.com>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???**

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