Skip to content

Commit

Permalink
Correctly handle null value for --base-wallet-routes
Browse files Browse the repository at this point in the history
Signed-off-by: Emiliano Suñé <emiliano.sune@gmail.com>
  • Loading branch information
esune committed Nov 21, 2024
1 parent 5916c81 commit f9bc38d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions acapy_agent/admin/decorators/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ def _base_wallet_route_access(additional_routes: str, request_path: str) -> bool
def _build_additional_routes_pattern(pattern_string: str) -> Optional[Pattern]:
"""Build pattern from space delimited list of paths."""
# create array and add word boundary to avoid false positives
paths = pattern_string.split(" ")
return re.compile("^((?:)" + "|".join(paths) + ")$")
if pattern_string:
paths = pattern_string.split(" ")
return re.compile("^((?:)" + "|".join(paths) + ")$")
return None


def _matches_additional_routes(pattern: Pattern, path: str) -> bool:
Expand Down

0 comments on commit f9bc38d

Please sign in to comment.