couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travis Jensen <>
Subject Confused handling of HEAD requests
Date Wed, 20 Jul 2011 22:03:15 GMT
couch_httpd.erl seems to be confused about what it wants to do with HEAD

On the one hand, it supports catching {http_head_abort, Resp} and will throw
that in start_response/3 and start_response_length/4 if your method is set
to HEAD.

On the other hand, it sets all HEAD requests to GET, so no handler can ever
know a HEAD request was made (instead, it lets Mochiweb strip the body).

I can appreciate the simplicity of the latter, but
the schizophrenic behavior seems odd. I've also got a custom handler that
would really like to know if it is HEAD or GET (generating the body takes a
lot of CPU, but I know its length because I store it in a document).

First question: should Couch really set all HEAD requests to GET?
(Personally, I think not)
Second question: does anybody know how bad it would be to remove that HEAD
-> GET mapping?


*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