From d13c5349b668344e11d18df86775c0fb38ce8372 Mon Sep 17 00:00:00 2001 From: macneiln Date: Mon, 7 Sep 2020 19:48:31 +1200 Subject: [PATCH] Add hash_extension variable Add hash_extension variable to requires_signature function so URL _signature can be verified ignoring the given request extension. --- gluon/tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gluon/tools.py b/gluon/tools.py index 9fafd48e..01095e05 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -3930,7 +3930,7 @@ class Auth(AuthAPI): return self.has_permission(name, table_name, record_id) return self.requires(has_permission, otherwise=otherwise) - def requires_signature(self, otherwise=None, hash_vars=True): + def requires_signature(self, otherwise=None, hash_vars=True, hash_extension=True): """ Decorator that prevents access to action if not logged in or if user logged in is not a member of group_id. @@ -3938,7 +3938,7 @@ class Auth(AuthAPI): group_id is calculated. """ def verify(): - return URL.verify(current.request, user_signature=True, hash_vars=hash_vars) + return URL.verify(current.request, user_signature=True, hash_vars=hash_vars, hash_extension=True) return self.requires(verify, otherwise) def accessible_query(self, name, table, user_id=None):