You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/07/09 18:59:19 UTC
[GitHub] [couchdb] nickva commented on a change in pull request #2991: Simplify using `req_body` for JSON requests
nickva commented on a change in pull request #2991:
URL: https://github.com/apache/couchdb/pull/2991#discussion_r452426181
##########
File path: src/chttpd/src/chttpd.erl
##########
@@ -681,8 +681,10 @@ json_body(Httpd) ->
case body(Httpd) of
undefined ->
throw({bad_request, "Missing request body"});
+ Body when is_binary(Body) ->
+ ?JSON_DECODE(maybe_decompress(Httpd, Body));
Body ->
Review comment:
Let's explicitly match on `{Props} when is_list(Props)` (or similar ejson match) to assert that the only other option is ejson here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org