You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2021/08/10 23:12:51 UTC

[couchdb-documentation] branch ddoc-update-function-post-method updated (de7aa56 -> c60aebb)

This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a change to branch ddoc-update-function-post-method
in repository https://gitbox.apache.org/repos/asf/couchdb-documentation.git.


 discard de7aa56  Fix allowed method for ddoc update function
     new c60aebb  Fix allowed method for ddoc update function

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (de7aa56)
            \
             N -- N -- N   refs/heads/ddoc-update-function-post-method (c60aebb)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:

[couchdb-documentation] 01/01: Fix allowed method for ddoc update function

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch ddoc-update-function-post-method
in repository https://gitbox.apache.org/repos/asf/couchdb-documentation.git

commit c60aebb10d5aa071d3e1456ef3ca949860213188
Author: Jay Doane <ja...@apache.org>
AuthorDate: Tue Aug 10 15:04:12 2021 -0700

    Fix allowed method for ddoc update function
    
    The semantics of PUT [1] are arguably incorrect for executing an
    update function on a specified document, since nothing is being
    created or updated. Also it's not clear why it would be different from
    the POST used for executing an update function for `null` document. [2]
    
    Additionally, the example code-block in this section uses POST:
    
            POST /recipes/_design/recipe/_update/ingredients/SpaghettiWithMeatballs HTTP/1.1
    
    All which lead me to believe that the PUT is a typo.
    
    The actual behavior of CouchDB doesn't help here, since it currently
    accepts any method whatsoever:
    
    $ curl -v -u adm localhost:15984/db-1/_design/ddoc/_update/change -X BOGUS
    
    > BOGUS /db-1/_design/bar/_update/change HTTP/1.1
    >
    < HTTP/1.1 200 OK
    < content-length: 11
    < content-type: text/html; charset=utf-8
    <
    * Connection #0 to host localhost left intact
    Empty World* Closing connection 0
    
    [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
    [2] https://docs.couchdb.org/en/latest/api/ddoc/render.html#post--db-_design-ddoc-_update-func
---
 src/api/ddoc/render.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/api/ddoc/render.rst b/src/api/ddoc/render.rst
index d7c7b0e..8324bcd 100644
--- a/src/api/ddoc/render.rst
+++ b/src/api/ddoc/render.rst
@@ -352,7 +352,7 @@
 ``/db/_design/design-doc/_update/update-name/doc-id``
 =====================================================
 
-.. http:put:: /{db}/_design/{ddoc}/_update/{func}/{docid}
+.. http:post:: /{db}/_design/{ddoc}/_update/{func}/{docid}
     :synopsis: Executes an update function against the specified document
 
     Executes :ref:`update function <updatefun>` on server side for the specified