summaryrefslogtreecommitdiff
path: root/apps/couch/src/couch_httpd_rewrite.erl
diff options
context:
space:
mode:
Diffstat (limited to 'apps/couch/src/couch_httpd_rewrite.erl')
-rw-r--r--apps/couch/src/couch_httpd_rewrite.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/couch/src/couch_httpd_rewrite.erl b/apps/couch/src/couch_httpd_rewrite.erl
index ca4ac1f0..6c3d0e3c 100644
--- a/apps/couch/src/couch_httpd_rewrite.erl
+++ b/apps/couch/src/couch_httpd_rewrite.erl
@@ -126,7 +126,10 @@ handle_rewrite_req(#httpd{
case couch_util:get_value(<<"rewrites">>, Props) of
undefined ->
couch_httpd:send_error(Req, 404, <<"rewrite_error">>,
- <<"Invalid path.">>);
+ <<"Invalid path.">>);
+ Bin when is_binary(Bin) ->
+ couch_httpd:send_error(Req, 400, <<"rewrite_error">>,
+ <<"Rewrite rules are a String. They must be a JSON Array.">>);
Rules ->
% create dispatch list from rules
DispatchList = [make_rule(Rule) || {Rule} <- Rules],