Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Return X-Couch-Id from show functions if doc is created

  • Loading branch information...
commit 6ae8dcd1b993fb81f90914a4353d12d0c66f830a 1 parent 4fc3a68
Robert Newson rnewson authored benoitc committed
3  apps/couch_httpd/share/www/script/test/update_documents.js
View
@@ -118,7 +118,8 @@ couchTests.update_documents = function(debug) {
xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/hello/"+docid);
T(xhr.status == 201);
T(xhr.responseText == "<p>hello doc</p>");
- T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")))
+ T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")));
+ T(equals(docid, xhr.getResponseHeader("X-Couch-Id")));
doc = db.open(docid);
T(doc.world == "hello");
5 apps/couch_mrview/src/couch_mrview_show.erl
View
@@ -146,7 +146,10 @@ send_doc_update_response(Req, Db, DDoc, UpdateName, Doc, DocId) ->
NewRevStr = couch_doc:rev_to_str(NewRev),
{[
{<<"code">>, 201},
- {<<"headers">>, {[{<<"X-Couch-Update-NewRev">>, NewRevStr}]}}
+ {<<"headers">>, {[
+ {<<"X-Couch-Update-NewRev">>, NewRevStr},
+ {<<"X-Couch-Id">>, NewDoc#doc.id}
+ ]}}
| JsonResp0]};
[<<"up">>, _Other, {JsonResp0}] ->
{[{<<"code">>, 200} | JsonResp0]}
Please sign in to comment.
Something went wrong with that request. Please try again.