check if method is added in strict slash logic
This commit is contained in:
@@ -130,8 +130,15 @@ class Router:
|
||||
return
|
||||
|
||||
# Add versions with and without trailing /
|
||||
slashed_methods = self.routes_all.get(uri + '/', frozenset({}))
|
||||
if isinstance(methods, Iterable):
|
||||
_slash_is_missing = all(method in slashed_methods for
|
||||
method in methods)
|
||||
else:
|
||||
_slash_is_missing = methods in slashed_methods
|
||||
|
||||
slash_is_missing = (
|
||||
not uri[-1] == '/' and not self.routes_all.get(uri + '/', False)
|
||||
not uri[-1] == '/' and not _slash_is_missing
|
||||
)
|
||||
without_slash_is_missing = (
|
||||
uri[-1] == '/' and not
|
||||
|
||||
Reference in New Issue
Block a user