summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shorin <kxepal@apache.org>2015-10-12 18:10:41 +0300
committerAlexander Shorin <kxepal@apache.org>2015-10-12 18:23:43 +0300
commitb9e1f3b5d5a78a706abb358e17130fb7344567d2 (patch)
treed1511a1c870be5f0cc51a7cebcf04e495775495c
parent747144ee259b1fe084ee041f783936a7ee1cf2de (diff)
downloadcouchdb-b9e1f3b5d5a78a706abb358e17130fb7344567d2.tar.gz
Return HTTP 405 for unsupported request method
-rw-r--r--src/setup_httpd.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/setup_httpd.erl b/src/setup_httpd.erl
index 32c610470..006ed455b 100644
--- a/src/setup_httpd.erl
+++ b/src/setup_httpd.erl
@@ -39,7 +39,10 @@ handle_setup_req(#httpd{method='GET'}=Req) ->
ok ->
chttpd:send_json(Req, 200, {[{state, cluster_finished}]})
end
- end.
+ end;
+handle_setup_req(#httpd{}=Req) ->
+ chttpd:send_method_not_allowed(Req, "GET,POST").
+
get_options(Options, Setup) ->
ExtractValues = fun({Tag, Option}, OptionsAcc) ->