From 4e691d374d0d1d23878ee507879b2c087cab8f38 Mon Sep 17 00:00:00 2001 From: Kazuhiko Shiozaki <kazuhiko@nexedi.com> Date: Sun, 2 Jan 2011 16:37:44 +0000 Subject: [PATCH] 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 --- product/ERP5Security/ERP5ExternalAuthenticationPlugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/product/ERP5Security/ERP5ExternalAuthenticationPlugin.py b/product/ERP5Security/ERP5ExternalAuthenticationPlugin.py index 6ad0ccf919..71b1bf3abd 100644 --- a/product/ERP5Security/ERP5ExternalAuthenticationPlugin.py +++ b/product/ERP5Security/ERP5ExternalAuthenticationPlugin.py @@ -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 -- 2.30.9