You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2016/04/22 08:02:20 UTC

[4/5] chttpd commit: updated refs/heads/2992-limit-doc-size to 1ac365d

Add check for _update handlers

COUCHDB-2992


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/0b0a3aca
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/0b0a3aca
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/0b0a3aca

Branch: refs/heads/2992-limit-doc-size
Commit: 0b0a3acaad204d00ea024f15c21dbdf2f01bae38
Parents: 8ddb1ce
Author: Tony Sun <to...@cloudant.com>
Authored: Thu Apr 21 18:46:07 2016 -0700
Committer: Tony Sun <to...@cloudant.com>
Committed: Thu Apr 21 18:46:07 2016 -0700

----------------------------------------------------------------------
 src/chttpd_db.erl   | 2 +-
 src/chttpd_show.erl | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/0b0a3aca/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 2f6e0c0..03a0b65 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -19,7 +19,7 @@
     db_req/2, couch_doc_open/4,handle_changes_req/2,
     update_doc_result_to_json/1, update_doc_result_to_json/2,
     handle_design_info_req/3, handle_view_cleanup_req/2,
-    update_doc/4, http_code_from_status/1]).
+    update_doc/4, http_code_from_status/1, maybe_verify_body_size/1]).
 
 -import(chttpd,
     [send_json/2,send_json/3,send_json/4,send_method_not_allowed/2,

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/0b0a3aca/src/chttpd_show.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_show.erl b/src/chttpd_show.erl
index 787df16..4bb9335 100644
--- a/src/chttpd_show.erl
+++ b/src/chttpd_show.erl
@@ -130,6 +130,7 @@ send_doc_update_response(Req, Db, DDoc, UpdateName, Doc, DocId) ->
                 Options = [{user_ctx, Req#httpd.user_ctx}, {w, W}]
             end,
             NewDoc = couch_doc:from_json_obj({NewJsonDoc}),
+            ok = chttpd_db:maybe_verify_body_size(NewDoc#doc.body),
             couch_doc:validate_docid(NewDoc#doc.id),
             {UpdateResult, NewRev} = fabric:update_doc(Db, NewDoc, Options),
             NewRevStr = couch_doc:rev_to_str(NewRev),