fix(webhook-action): fix webhook action path type error
This commit is contained in:
parent
e5c4277109
commit
e0336e60da
|
@ -314,14 +314,15 @@ ensure_content_type_header(Headers, _Method) ->
|
||||||
lists:keydelete("content-type", 1, Headers).
|
lists:keydelete("content-type", 1, Headers).
|
||||||
|
|
||||||
merge_path(CommonPath, <<>>) ->
|
merge_path(CommonPath, <<>>) ->
|
||||||
CommonPath;
|
l2b(CommonPath);
|
||||||
merge_path(CommonPath, Path0) ->
|
merge_path(CommonPath, Path0) ->
|
||||||
case emqx_http_lib:uri_parse(Path0) of
|
case emqx_http_lib:uri_parse(Path0) of
|
||||||
{ok, #{path := Path1, 'query' := Query}} ->
|
{ok, #{path := Path1, 'query' := Query0}} ->
|
||||||
Path2 = filename:join(CommonPath, Path1),
|
Path2 = l2b(filename:join(CommonPath, Path1)),
|
||||||
|
Query = l2b(Query0),
|
||||||
<<Path2/binary, "?", Query/binary>>;
|
<<Path2/binary, "?", Query/binary>>;
|
||||||
{ok, #{path := Path1}} ->
|
{ok, #{path := Path1}} ->
|
||||||
filename:join(CommonPath, Path1)
|
l2b(filename:join(CommonPath, Path1))
|
||||||
end.
|
end.
|
||||||
|
|
||||||
method(GET) when GET == <<"GET">>; GET == <<"get">> -> get;
|
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}]),
|
?LOG(error, "check http_connectivity failed: ~p, ~0p", [Conf, {Err, Reason, ST}]),
|
||||||
false
|
false
|
||||||
end.
|
end.
|
||||||
|
l2b(L) when is_list(L) -> iolist_to_binary(L);
|
||||||
|
l2b(Any) -> Any.
|
||||||
|
|
Loading…
Reference in New Issue