You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Nathan Vander Wilt (JIRA)" <ji...@apache.org> on 2011/04/28 22:57:03 UTC
[jira] [Created] (COUCHDB-1146) Content-Length ignored on GET
requests
Content-Length ignored on GET requests
--------------------------------------
Key: COUCHDB-1146
URL: https://issues.apache.org/jira/browse/COUCHDB-1146
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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (COUCHDB-1146) Content-Length ignored on GET
requests
Posted by "Mark Doliner (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13250401#comment-13250401 ]
Mark Doliner commented on COUCHDB-1146:
---------------------------------------
This happens with PUT requests when creating a new database, too. (http://wiki.apache.org/couchdb/HTTP_database_API#PUT_.28Create_New_Database.29)
And the problem is actually a little worse than originally described...
If the HTTP body arrives in a separate TCP chunk from the headers (as will happen in Nathan's telnet example) then couchdb will treat the body as invalid data and send a TCP RST to the client. If the client hasn't finished reading the previous response yet then it might treat the RST as an error and bail out. And yes, it's weird for a client to send a body in a PUT request when creating a database (I was doing this on accident).
The HTTP/1.1 RFC (2616) says, "a server SHOULD read and forward a message-body on any request" (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3).
> Content-Length ignored on GET requests
> --------------------------------------
>
> Key: COUCHDB-1146
> URL: https://issues.apache.org/jira/browse/COUCHDB-1146
> 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. https://github.com/joyent/node/issues/989 ).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (COUCHDB-1146) Content-Length ignored on GET
requests
Posted by "Mark Doliner (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13250407#comment-13250407 ]
Mark Doliner commented on COUCHDB-1146:
---------------------------------------
A similar problem is described here, which different steps to reproduce:
http://mail-archives.apache.org/mod_mbox/couchdb-user/201201.mbox/%3CCAN-3CB+d2N81vuuxPnVw1NgKWWc9vOUV5Zf6yQOzGBrRXzrWfg@mail.gmail.com%3E
Looks like it can also happen if a request is disallowed for some reason.
> Content-Length ignored on GET requests
> --------------------------------------
>
> Key: COUCHDB-1146
> URL: https://issues.apache.org/jira/browse/COUCHDB-1146
> 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. https://github.com/joyent/node/issues/989 ).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (COUCHDB-1146) Content-Length ignored on GET
requests
Posted by "Jason Smith (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13250411#comment-13250411 ]
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: https://issues.apache.org/jira/browse/COUCHDB-1146
> 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. https://github.com/joyent/node/issues/989 ).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (COUCHDB-1146) Content-Length ignored on GET
requests
Posted by "Nathan Vander Wilt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Vander Wilt updated COUCHDB-1146:
----------------------------------------
Description:
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 (eg https://github.com/joyent/node/issues/989).
was:
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.
> Content-Length ignored on GET requests
> --------------------------------------
>
> Key: COUCHDB-1146
> URL: https://issues.apache.org/jira/browse/COUCHDB-1146
> 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 (eg https://github.com/joyent/node/issues/989).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (COUCHDB-1146) Content-Length ignored on GET
requests
Posted by "Nathan Vander Wilt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Vander Wilt updated COUCHDB-1146:
----------------------------------------
Description:
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. https://github.com/joyent/node/issues/989 ).
was:
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 (eg https://github.com/joyent/node/issues/989).
> Content-Length ignored on GET requests
> --------------------------------------
>
> Key: COUCHDB-1146
> URL: https://issues.apache.org/jira/browse/COUCHDB-1146
> 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. https://github.com/joyent/node/issues/989 ).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira