Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1113

GET requests fail against a list if they have content-type x-www-form-urlencoded

    XMLWordPrintableJSON

Details

    • New Contributors Level (Easy)

    Description

      Given a design doc like:

      {
      views:

      {whatever...}

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dbfclark Dennis Clark
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified