couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Smith (Commented) (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-1146) Content-Length ignored on GET requests
Date Tue, 10 Apr 2012 02:27:16 GMT


Jason Smith commented on COUCHDB-1146:

This bug is the bane of my existence.

It was introduced with the Mochiweb upgrade when CouchDB added SSL support.

Note, the error can also happen with unauthorized requests. For example, if you PUT to /_config/foo/bar
with a body but perhaps you typed your password wrong, you will get the rejection and subsequent
RST packet.

This is not just "rude" but it is a bug. Regardless of the spec, RST is a de facto error condition.
Many languages treat it as an exception and reflect that in application code. It has caused
problems for me in Node.js and Erlang for example.
> Content-Length ignored on GET requests
> --------------------------------------
>                 Key: COUCHDB-1146
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>            Reporter: Nathan Vander Wilt
> In the case of a GET request, CouchDB does not wait for the client to send any content
promised by a Content-Length header but sends its response as soon as the last header is received.
This can confuse some HTTP client libraries (such as node.js) that do not expect to receive
a response before they have finished the request.
> To reproduce:
> $ telnet localhost 5984
> GET / HTTP/1.1
> Content-Length: 3
> ...
> Expected results:
> No response from CouchDB until last "." is typed
> Actual results:
> CouchDB sends response and closes the client's connection as soon as request headers
are done.
> From IRC conversation (and RFC 2616) this doesn't seem to be out-of-spec per se, but
is a bit "rude" and therefore can break fragile clients (e.g.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message