Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge branch '64229-add-new-request-parameter'
Closes #233
  • Loading branch information
nickva committed Mar 8, 2017
2 parents f99e30c + 0420f40 commit 9d8be06e4ba823165f385667a360e7c050427918
Showing 2 changed files with 4 additions and 5 deletions.
@@ -451,7 +451,7 @@ validate_ctype(Req, Ctype) ->

check_max_request_length(Req) ->
Len = list_to_integer(header_value(Req, "Content-Length", "0")),
MaxLen = config:get_integer("couchdb", "max_document_size", 4294967296),
MaxLen = config:get_integer("httpd", "max_http_request_size", 4294967296),
case Len > MaxLen of
true ->
exit({body_too_large, Len});
@@ -576,8 +576,7 @@ body_length(#httpd{mochi_req=MochiReq}) ->
MochiReq:get(body_length).

body(#httpd{mochi_req=MochiReq, req_body=undefined}) ->
MaxSize = list_to_integer(
config:get("couchdb", "max_document_size", "4294967296")),
MaxSize = config:get_integer("httpd", "max_http_request_size", 4294967296),
MochiReq:recv_body(MaxSize);
body(#httpd{req_body=ReqBody}) ->
ReqBody.
@@ -63,8 +63,8 @@ json_req_obj(#httpd{mochi_req=Req,
}, Db, DocId) ->
Body = case ReqBody of
undefined ->
MaxSize = list_to_integer(
config:get("couchdb", "max_document_size", "4294967296")),
MaxSize = config:get_integer("httpd", "max_http_request_size",
4294967296),
Req:recv_body(MaxSize);
Else -> Else
end,

0 comments on commit 9d8be06

Please sign in to comment.