When matching URL patterns, the last elem should always at least one char (#4021)

This commit is contained in:
Bert Blommers 2021-06-20 10:56:40 +01:00 committed by GitHub
parent e4057a34b9
commit e11dd49edf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -333,7 +333,7 @@ class BaseResponse(_TemplateEnvironmentMixin, ActionAuthenticatorMixin):
.replace("-", "_")
)
if is_last:
return "(?P<%s>[^/]*)" % name
return "(?P<%s>[^/]+)" % name
return "(?P<%s>.*)" % name
elems = uri.split("/")