Commit 4e691d37 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

modify the code so that request.get_header is evaluated only when...

modify the code so that request.get_header is evaluated only when request.getHeader does not exist (even though request.get_header still exists in Zope-2.12).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41927 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 60736030
......@@ -102,7 +102,11 @@ class ERP5ExternalAuthenticationPlugin(ERP5UserManager):
def extractCredentials(self, request):
""" Extract credentials from the request header. """
creds = {}
user_id = getattr(request, 'getHeader', request.get_header)(self.user_id_key)
getHeader = getattr(request, 'getHeader', None)
if getHeader is None:
# use get_header instead for Zope-2.8
getHeader = request.get_header
user_id = getHeader(self.user_id_key)
if user_id is not None:
creds['external_login'] = user_id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment