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 22:25:39 UTC

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

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 ab95657  Fix allowed method for ddoc update function
     new de7aa56  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   (ab95657)
            \
             N -- N -- N   refs/heads/ddoc-update-function-post-method (de7aa56)

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 de7aa56702b2d06538d9924995ebd4a9caf3c3b6
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 running an update
    function on an existing document, since nothing is being created or
    updated, and it's not clear why it would be different from the POST
    used for running an update function on the `null` document.
    
    Also, the example code-block in this section uses POST:
    
            POST /recipes/_design/recipe/_update/ingredients/SpaghettiWithMeatballs HTTP/1.1
    
    leading 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
---
 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