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.

Reply via email to