fix(bridge_resource): use more lax parsing of bridge id

This commit is contained in:
Thales Macedo Garitezi 2023-10-26 13:48:33 -03:00 committed by Zaiming (Stone) Shi
parent d574821160
commit 83e05b0d77
1 changed files with 2 additions and 0 deletions

View File

@ -110,6 +110,8 @@ parse_bridge_id(BridgeId, Opts) ->
case string:split(bin(BridgeId), ":", all) of
[Type, Name] ->
{to_type_atom(Type), validate_name(Name, Opts)};
[Bridge, Type, Name] when Bridge =:= <<"bridge">>; Bridge =:= "bridge" ->
{to_type_atom(Type), validate_name(Name, Opts)};
_ ->
invalid_data(
<<"should be of pattern {type}:{name}, but got ", BridgeId/binary>>