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:04:30 UTC

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

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 ab956572026d252c68a20a3a820cecb2e1f4b63b
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 are incorrect for running an update function on
    an existing document, since nothing is being created or updated. [1]
    
    Also, the code-block in this section uses POST:
    
            POST /recipes/_design/recipe/_update/ingredients/SpaghettiWithMeatballs HTTP/1.1
    
    leading me to believe that this PUT is a typo.
    
    The actual behavior of CouchDB doesn't help here, since it currently
    accepts any method whatsoever:
    
    $ curl -u adm localhost:15984/db-1/_design/ddoc/_update/change -X BOGUS
    a-200-response
    
    [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