From b9e1f3b5d5a78a706abb358e17130fb7344567d2 Mon Sep 17 00:00:00 2001 From: Alexander Shorin Date: Mon, 12 Oct 2015 18:10:41 +0300 Subject: [PATCH] Return HTTP 405 for unsupported request method --- src/setup_httpd.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/setup_httpd.erl b/src/setup_httpd.erl index 32c6104..006ed45 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) ->