44import logging
55import re
66from dataclasses import dataclass , field
7- from typing import Dict , Optional , Sequence , Union
7+ from typing import Dict , Optional , Sequence
88from urllib .parse import urlparse
99
1010from starlette .requests import Request
@@ -26,7 +26,7 @@ def extract_variables(url: str) -> dict:
2626 return {k : v for k , v in match .groupdict ().items () if v } if match else {}
2727
2828
29- def as_patterns (value : Union [ str , Sequence [str ], None ] ) -> Sequence [str ]:
29+ def as_patterns (value : str | Sequence [str ] | None ) -> Sequence [str ]:
3030 """Normalize a filter path setting to a list of regex patterns."""
3131 if value is None :
3232 return []
@@ -63,8 +63,8 @@ def find_match(
6363 private_endpoints : EndpointMethods ,
6464 public_endpoints : EndpointMethods ,
6565 default_public : bool ,
66- items_filter_path : Union [ str , Sequence [str ], None ] = None ,
67- collections_filter_path : Union [ str , Sequence [str ], None ] = None ,
66+ items_filter_path : str | Sequence [str ] | None = None ,
67+ collections_filter_path : str | Sequence [str ] | None = None ,
6868) -> "MatchResult" :
6969 """Check if the given path and method match any of the regex patterns and methods in the endpoints."""
7070 primary_endpoints = private_endpoints if default_public else public_endpoints
0 commit comments