From f6025404e31baa24b8f0bd69b865484845e68293 Mon Sep 17 00:00:00 2001 From: turtled Date: Tue, 12 Sep 2017 10:57:04 +0800 Subject: [PATCH] Update clean_acl_cache API --- src/emqttd_rest_api.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/emqttd_rest_api.erl b/src/emqttd_rest_api.erl index 41c689cab..d0ab6a855 100644 --- a/src/emqttd_rest_api.erl +++ b/src/emqttd_rest_api.erl @@ -138,8 +138,9 @@ kick_client('DELETE', _Params, Key) -> false -> {error, [{code, ?ERROR12}]} end. -clean_acl_cache('PUT', Params, Key) -> +clean_acl_cache('PUT', Params, Key0) -> Topic = get_value(<<"topic">>, Params), + [Key | _] = string:tokens(Key0, "/"), case emqttd_mgmt:clean_acl_cache(l2b(Key), Topic) of true -> {ok, []}; false -> {error, [{code, ?ERROR12}]}