fix(webhook): fix the issue that the path field does not support rule engine variables
This commit is contained in:
parent
ac5307a3a5
commit
83981e7c87
|
@ -311,15 +311,12 @@ ensure_content_type_header(Headers, _Method) ->
|
||||||
|
|
||||||
merge_path(CommonPath, <<>>) ->
|
merge_path(CommonPath, <<>>) ->
|
||||||
l2b(CommonPath);
|
l2b(CommonPath);
|
||||||
merge_path(CommonPath, Path0) ->
|
merge_path(CommonPath, Path) ->
|
||||||
case emqx_http_lib:uri_parse(Path0) of
|
Path1 = case Path of
|
||||||
{ok, #{path := Path1, 'query' := Query0}} ->
|
<<"/", Path0/binary>> -> Path0;
|
||||||
Path2 = l2b(filename:join(CommonPath, Path1)),
|
_ -> Path
|
||||||
Query = l2b(Query0),
|
end,
|
||||||
<<Path2/binary, "?", Query/binary>>;
|
l2b(filename:join(CommonPath, Path1)).
|
||||||
{ok, #{path := Path1}} ->
|
|
||||||
l2b(filename:join(CommonPath, Path1))
|
|
||||||
end.
|
|
||||||
|
|
||||||
method(GET) when GET == <<"GET">>; GET == <<"get">> -> get;
|
method(GET) when GET == <<"GET">>; GET == <<"get">> -> get;
|
||||||
method(POST) when POST == <<"POST">>; POST == <<"post">> -> post;
|
method(POST) when POST == <<"POST">>; POST == <<"post">> -> post;
|
||||||
|
|
Loading…
Reference in New Issue