Sfoglia il codice sorgente

fix: remove bindings params url decode (url decode by minirest)

DDDHuang 4 anni fa
parent
commit
0e3310f1cf
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      apps/emqx_modules/src/emqx_topic_metrics_api.erl

+ 4 - 4
apps/emqx_modules/src/emqx_topic_metrics_api.erl

@@ -290,11 +290,11 @@ topic_metrics(post, #{body := #{<<"topic">> := Topic}}) ->
             reason2httpresp(Reason)
             reason2httpresp(Reason)
     end.
     end.
 
 
-operate_topic_metrics(get, #{bindings := #{topic := Topic0}}) ->
-    get_cluster_response([emqx_http_lib:uri_decode(Topic0)]);
+operate_topic_metrics(get, #{bindings := #{topic := Topic}}) ->
+    get_cluster_response([Topic]);
 
 
-operate_topic_metrics(delete, #{bindings := #{topic := Topic0}}) ->
-    case emqx_modules_conf:remove_topic_metrics(emqx_http_lib:uri_decode(Topic0)) of
+operate_topic_metrics(delete, #{bindings := #{topic := Topic}}) ->
+    case emqx_modules_conf:remove_topic_metrics(Topic) of
         ok -> {204};
         ok -> {204};
         {error, Reason} -> reason2httpresp(Reason)
         {error, Reason} -> reason2httpresp(Reason)
     end.
     end.