incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <>
Subject Re: problem with temp view
Date Thu, 23 Apr 2009 19:26:58 GMT
On Thu, Apr 23, 2009 at 3:10 PM, Brian Candler <> wrote:
> On Thu, Apr 23, 2009 at 01:53:09PM +0530, Debasish Ghosh wrote:
>> $ curl -vX POST -H "Content-Type: application/json" -d '{"map" :
>> "function(doc) { emit(null, doc) }"}'
>> http://localhost:5984/hello-world/_tmp_view
>> the error that I get is the following ..
>> {"error":"bad_content_type","reason":"Invalid Content-Type header for form
>> upload"}
> It's _temp_view, not _tmp_view.
> There have been some changes made recently which mean that POSTs which
> aren't application/x-form-post are rejected.

POSTs to a /db_name/docid are now rejected if they're not multipart/form-data

However names beginning with an
> underscore are reserved.

Not at all. Couch will use anything you specify in the ini files with
no complaint. Underscores are just preferred because docids can't
start with an underscore if they're not a _local or _design document.

> A quick check suggests that things are a bit too lax: a PUT to /db/_tmp_view
> actually creates a document with id _tmp_view (I would have thought this
> should be rejected?)

It most definitely should be. There should be a test case that checks
for that somewhere.  If not could you add a ticket to JIRA with a
failing JS test?

> I believe it's possible to use POST to create an attachment. Perhaps CouchDB
> thinks that your post to /db/_tmp_view is an attempt to create an attachment
> on a document whose id is _tmp_view?


> It's certainly a very confusing error.
> Regards,
> Brian.

Paul Davis

View raw message