fix: don't require path in http action(fill default path)

This commit is contained in:
zhongwencool 2023-12-12 10:15:53 +08:00
parent 4fc14fb4ba
commit cd1365d753
2 changed files with 3 additions and 7 deletions

View File

@ -67,7 +67,7 @@ connector_action_config_to_bridge_v1_config(ConnectorConfig, ActionConfig) ->
}.
bridge_v1_config_to_connector_config(BridgeV1Conf) ->
%% To statisfy the emqx_bridge_api_SUITE:t_http_crud_apis/1
%% To satisfy the emqx_bridge_api_SUITE:t_http_crud_apis/1
ok = validate_webhook_url(maps:get(<<"url">>, BridgeV1Conf, undefined)),
maps:without(?REMOVED_KEYS ++ ?ACTION_KEYS ++ ?PARAMETER_KEYS, BridgeV1Conf).

View File

@ -565,12 +565,8 @@ preprocess_request(undefined) ->
undefined;
preprocess_request(Req) when map_size(Req) == 0 ->
undefined;
preprocess_request(
#{
method := Method,
path := Path
} = Req
) ->
preprocess_request(#{method := Method} = Req) ->
Path = maps:get(path, Req, <<>>),
Headers = maps:get(headers, Req, []),
#{
method => parse_template(to_bin(Method)),