diff options
-rw-r--r-- | rebar.config.script | 2 | ||||
-rw-r--r-- | src/chttpd/src/chttpd_misc.erl | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/rebar.config.script b/rebar.config.script index 65c3a8a04..c3c05dde3 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -48,7 +48,7 @@ SubDirs = [ DepDescs = [ %% Independent Apps -{config, "config", {tag, "2.1.3"}}, +{config, "config", {tag, "2.1.4"}}, {b64url, "b64url", {tag, "1.0.1"}}, {ets_lru, "ets-lru", {tag, "1.0.0"}}, {khash, "khash", {tag, "1.0.1"}}, diff --git a/src/chttpd/src/chttpd_misc.erl b/src/chttpd/src/chttpd_misc.erl index fc03fb512..efa7ef338 100644 --- a/src/chttpd/src/chttpd_misc.erl +++ b/src/chttpd/src/chttpd_misc.erl @@ -323,8 +323,12 @@ handle_node_req(#httpd{method='DELETE',path_parts=[_, Node, <<"_config">>, Secti undefined -> throw({not_found, unknown_config_value}); OldValue -> - call_node(Node, config, delete, [Section, Key, Persist]), - send_json(Req, 200, list_to_binary(OldValue)) + case call_node(Node, config, delete, [Section, Key, Persist]) of + ok -> + send_json(Req, 200, list_to_binary(OldValue)); + {error, Reason} -> + chttpd:send_error(Req, {bad_request, Reason}) + end end; handle_node_req(#httpd{path_parts=[_, _Node, <<"_config">>, _Section, _Key]}=Req) -> send_method_not_allowed(Req, "GET,PUT,DELETE"); |