mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
Update rest_framework/urlpatterns.py
Co-authored-by: Tom Christie <tom@tomchristie.com>
This commit is contained in:
parent
3dbb45dc4b
commit
3ff562030c
|
@ -9,7 +9,8 @@ def _get_format_path_converter(suffix_kwarg, allowed):
|
|||
if len(allowed) == 1:
|
||||
allowed_pattern = allowed[0]
|
||||
else:
|
||||
allowed_pattern = f'(?:{"|".join(allowed)})'
|
||||
allowed_cases = "|".join(allowed)
|
||||
allowed_pattern = f'(?:{allowed_cases})'
|
||||
suffix_pattern = r"\.%s/?" % allowed_pattern
|
||||
else:
|
||||
suffix_pattern = r"\.[a-z0-9]+/?"
|
||||
|
|
Loading…
Reference in New Issue
Block a user