diff --git a/apps/emqx_web_hook/src/emqx_web_hook_actions.erl b/apps/emqx_web_hook/src/emqx_web_hook_actions.erl index f2c03233a..2cbc53475 100644 --- a/apps/emqx_web_hook/src/emqx_web_hook_actions.erl +++ b/apps/emqx_web_hook/src/emqx_web_hook_actions.erl @@ -314,14 +314,15 @@ ensure_content_type_header(Headers, _Method) -> lists:keydelete("content-type", 1, Headers). merge_path(CommonPath, <<>>) -> - CommonPath; + l2b(CommonPath); merge_path(CommonPath, Path0) -> case emqx_http_lib:uri_parse(Path0) of - {ok, #{path := Path1, 'query' := Query}} -> - Path2 = filename:join(CommonPath, Path1), + {ok, #{path := Path1, 'query' := Query0}} -> + Path2 = l2b(filename:join(CommonPath, Path1)), + Query = l2b(Query0), <>; {ok, #{path := Path1}} -> - filename:join(CommonPath, Path1) + l2b(filename:join(CommonPath, Path1)) end. method(GET) when GET == <<"GET">>; GET == <<"get">> -> get; @@ -386,3 +387,5 @@ test_http_connect(Conf) -> ?LOG(error, "check http_connectivity failed: ~p, ~0p", [Conf, {Err, Reason, ST}]), false end. +l2b(L) when is_list(L) -> iolist_to_binary(L); +l2b(Any) -> Any.