Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.0.2
-
all, but particularly JQuery
-
New Contributors Level (Easy)
Description
Given a design doc like:
{
views:
lists: {myList: function (head, req) { ...}}
}
an ajax request in JQuery like:
$.get("/db/_design/ddoc/_list/myList/whatever", function (data)
{...});
will fail with a 500 error of type function_clause. This appears to be because CouchDB is attempting to parse the empty form it assumes must be there based on the content type and mochiweb's parser fails.
Of course, if you try the same url in a browser or with curl, it'll work perfectly.
This may be for deep reasons beyond my ken, but the silent failure of the HTTP API in this case seems like a problem. At the very least, an informative error message would be good.