From b28c751856ff48ddb1cb87cb8763de5d1c42771d Mon Sep 17 00:00:00 2001 From: DDDHuang <44492639+DDDHuang@users.noreply.github.com> Date: Fri, 15 Apr 2022 15:47:21 +0800 Subject: [PATCH] fix: backup data filename, uri decode --- CHANGES-4.3.md | 1 + apps/emqx_management/src/emqx_management.app.src | 2 +- apps/emqx_management/src/emqx_management.appup.src | 4 ++-- apps/emqx_management/src/emqx_mgmt_api_data.erl | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index 29ea968a8..8cf54af70 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -45,6 +45,7 @@ File format: * Silence grep/sed warnings in docker-entrypoint.sh. [#7520] * Generate `loaded_modules` and `loaded_plugins` files with default values when no such files exists. [#7520] * Fix the configuration `server_name_indication` set to disable does not take effect. +* Fix backup files are not deleted and downloaded correctly when the API path has ISO8859-1 escape characters. ## v4.3.13 diff --git a/apps/emqx_management/src/emqx_management.app.src b/apps/emqx_management/src/emqx_management.app.src index bee65781a..64f44637a 100644 --- a/apps/emqx_management/src/emqx_management.app.src +++ b/apps/emqx_management/src/emqx_management.app.src @@ -1,6 +1,6 @@ {application, emqx_management, [{description, "EMQ X Management API and CLI"}, - {vsn, "4.3.11"}, % strict semver, bump manually! + {vsn, "4.3.12"}, % strict semver, bump manually! {modules, []}, {registered, [emqx_management_sup]}, {applications, [kernel,stdlib,minirest]}, diff --git a/apps/emqx_management/src/emqx_management.appup.src b/apps/emqx_management/src/emqx_management.appup.src index a91868861..7fa9b6d6f 100644 --- a/apps/emqx_management/src/emqx_management.appup.src +++ b/apps/emqx_management/src/emqx_management.appup.src @@ -1,13 +1,13 @@ %% -*- mode: erlang -*- {VSN, - [ {<<"4\\.3\\.([0-9]|1[0])">>, + [ {<<"4\\.3\\.([0-9]|1[0-1])">>, [ {apply,{minirest,stop_http,['http:management']}}, {apply,{minirest,stop_http,['https:management']}}, {restart_application, emqx_management} ]}, {<<".*">>, []} ], - [ {<<"4\\.3\\.([0-9]|1[0])">>, + [ {<<"4\\.3\\.([0-9]|1[0-1])">>, [ {apply,{minirest,stop_http,['http:management']}}, {apply,{minirest,stop_http,['https:management']}}, {restart_application, emqx_management} diff --git a/apps/emqx_management/src/emqx_mgmt_api_data.erl b/apps/emqx_management/src/emqx_mgmt_api_data.erl index e835f48d7..c24f4793b 100644 --- a/apps/emqx_management/src/emqx_mgmt_api_data.erl +++ b/apps/emqx_management/src/emqx_mgmt_api_data.erl @@ -177,7 +177,8 @@ dump_to_tmp_file(Content) -> ok = file:write_file(fullname(Filename), Bin), Filename. -fullname(Name) -> +fullname(Name0) -> + Name = uri_string:percent_decode(Name0), filename:join(emqx:get_env(data_dir), Name). tmp_filename() ->