diff options
author | John Christopher Anderson <jchris@apache.org> | 2010-07-20 01:04:22 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2010-07-20 01:04:22 +0000 |
commit | 9ebb79a24eecc2004a211b2475ffb7b34f31d138 (patch) | |
tree | 9b3f928568d142b8206d3d2d8a6d6e9f22c07278 /src/couchdb/couch_httpd_view.erl | |
parent | 2f25ac7fb8fc46a45ec0e3e746a6104becff6ce6 (diff) |
require application/json content-type in the remaining places where a POST has side-effects
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@965702 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_view.erl')
-rw-r--r-- | src/couchdb/couch_httpd_view.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl index 65aa364a..fc0c24a8 100644 --- a/src/couchdb/couch_httpd_view.erl +++ b/src/couchdb/couch_httpd_view.erl @@ -61,6 +61,7 @@ handle_view_req(#httpd{method='GET', handle_view_req(#httpd{method='POST', path_parts=[_, _, DName, _, ViewName]}=Req, Db, _DDoc) -> + couch_httpd:validate_ctype(Req, "application/json"), {Fields} = couch_httpd:json_body_obj(Req), case couch_util:get_value(<<"keys">>, Fields, nil) of nil -> @@ -77,6 +78,7 @@ handle_view_req(Req, _Db, _DDoc) -> send_method_not_allowed(Req, "GET,POST,HEAD"). handle_temp_view_req(#httpd{method='POST'}=Req, Db) -> + couch_httpd:validate_ctype(Req, "application/json"), ok = couch_db:check_is_admin(Db), couch_stats_collector:increment({httpd, temporary_view_reads}), {Props} = couch_httpd:json_body_obj(Req), |