Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
Rename max_document_size to max_http_request_size
`max_document_size` is implemented as `max_http_request_size`. There was no
real check for document size. In some cases the implementation was close enough
of a proxy (PUT-ing and GET-ing single docs), but in some edge cases, like
_bulk_docs requests the discrepancy between request size and document size
could be rather large.

The section was changed accordingly from `couchdb` to `httpd`. `httpd` was
chosen as it applies to both clustered as well as local interface.

There is a parallel effort to implement an actual max_document_size check. The
set of commit should be merged close enough together to allow for a backwards
compatible transition.

  • Loading branch information
nickva committed Mar 7, 2017
1 parent 90bd048 commit a1470e3bdbcb4b98d9cc7f5dc3641a2b008df16b
Showing 2 changed files with 3 additions and 3 deletions.
@@ -629,8 +629,8 @@ body(#httpd{mochi_req=MochiReq, req_body=ReqBody}) ->
case ReqBody of
undefined ->
% Maximum size of document PUT request body (4GB)
MaxSize = list_to_integer(
config:get("couchdb", "max_document_size", "4294967296")),
MaxSize = config:get_integer("httpd", "max_http_request_size",
Begin = os:timestamp(),
@@ -93,7 +93,7 @@ json_req_obj_field(<<"headers">>, #httpd{mochi_req=Req}, _Db, _DocId) ->
Hlist = mochiweb_headers:to_list(Headers),
json_req_obj_field(<<"body">>, #httpd{req_body=undefined, mochi_req=Req}, _Db, _DocId) ->
MaxSize = config:get_integer("couchdb", "max_document_size", 4294967296),
MaxSize = config:get_integer("httpd", "max_http_request_size", 4294967296),
catch exit:normal ->

0 comments on commit a1470e3

Please sign in to comment.