Fix #1013976 (Content Server with iPad problems)

This commit is contained in:
Kovid Goyal 2012-06-16 12:38:45 +05:30
parent d602d43247
commit 8d42bfb222

View File

@ -102,7 +102,12 @@ class AuthController(object):
@wraps(func) @wraps(func)
def authenticate(*args, **kwargs): def authenticate(*args, **kwargs):
cookie = cherrypy.request.cookie.get(self.cookie_name, None) cookie = cherrypy.request.cookie.get(self.cookie_name, None)
if not (allow_cookie_auth and self.is_valid(cookie)): ua = cherrypy.request.headers.get('User-Agent', '').strip()
if ('iPad;' in ua or 'iPhone;' in ua or (
not (allow_cookie_auth and self.is_valid(cookie)))):
# Apparently the iPad cant handle this
# see https://bugs.launchpad.net/bugs/1013976
digest_auth(self.realm, get_ha1_dict_plain(self.users_dict), digest_auth(self.realm, get_ha1_dict_plain(self.users_dict),
self.secret) self.secret)