fix: don't urldecode twice clientid

This commit is contained in:
zhongwencool 2023-09-15 17:36:48 +08:00
parent d72348c8ed
commit 640dd130fa
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
{application, emqx_management, [ {application, emqx_management, [
{description, "EMQX Management API and CLI"}, {description, "EMQX Management API and CLI"},
% strict semver, bump manually! % strict semver, bump manually!
{vsn, "5.0.29"}, {vsn, "5.0.30"},
{modules, []}, {modules, []},
{registered, [emqx_management_sup]}, {registered, [emqx_management_sup]},
{applications, [kernel, stdlib, emqx_plugins, minirest, emqx, emqx_ctl, emqx_bridge_http]}, {applications, [kernel, stdlib, emqx_plugins, minirest, emqx, emqx_ctl, emqx_bridge_http]},

View File

@ -647,7 +647,7 @@ set_keepalive(put, #{bindings := #{clientid := ClientID}, body := Body}) ->
error -> error ->
{400, 'BAD_REQUEST', "Interval Not Found"}; {400, 'BAD_REQUEST', "Interval Not Found"};
{ok, Interval} -> {ok, Interval} ->
case emqx_mgmt:set_keepalive(emqx_mgmt_util:urldecode(ClientID), Interval) of case emqx_mgmt:set_keepalive(ClientID, Interval) of
ok -> lookup(#{clientid => ClientID}); ok -> lookup(#{clientid => ClientID});
{error, not_found} -> {404, ?CLIENTID_NOT_FOUND}; {error, not_found} -> {404, ?CLIENTID_NOT_FOUND};
{error, Reason} -> {400, #{code => 'PARAMS_ERROR', message => Reason}} {error, Reason} -> {400, #{code => 'PARAMS_ERROR', message => Reason}}