diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-09-10 13:36:09 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-09-10 13:36:09 +0200 |
commit | cd99410a04685bbffed04091a7ad03e017140277 (patch) | |
tree | 5de430aad1d8c411fc665c38b994a59d52450c92 /module/web/utils.py | |
parent | changed config + progress api (diff) | |
download | pyload-cd99410a04685bbffed04091a7ad03e017140277.tar.xz |
cosmetic fixed, changed default server to threaded
Diffstat (limited to 'module/web/utils.py')
-rw-r--r-- | module/web/utils.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/module/web/utils.py b/module/web/utils.py index d0c782b68..967fc3412 100644 --- a/module/web/utils.py +++ b/module/web/utils.py @@ -51,14 +51,14 @@ def is_mobile(): return True else: return False - mobile_ua = request.headers.get('User-Agent').lower() - if (mobile_ua.find('opera mini') > 0): + mobile_ua = request.headers.get('User-Agent', '').lower() + if mobile_ua.find('opera mini') > 0: return True - if (mobile_ua.find('windows') > 0): + if mobile_ua.find('windows') > 0: return False - if (request.headers.get('Accept').lower().find('application/vnd.wap.xhtml+xml') > 0): + if request.headers.get('Accept', '').lower().find('application/vnd.wap.xhtml+xml') > 0: return True - if (re.search('(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)', mobile_ua) is not None): + if re.search('(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)', mobile_ua) is not None: return True mobile_ua = mobile_ua[:4] mobile_agents = ['w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac','blaz','brew','cell','cldc','cmd-', @@ -67,7 +67,7 @@ def is_mobile(): 'phil','play','port','prox','qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar','sie-', 'siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-','tosh','tsm-','upg1','upsi','vk-v','voda', 'wap-','wapa','wapi','wapp','wapr','webc','winw','winw','xda ','xda-'] - if (mobile_ua in mobile_agents): + if mobile_ua in mobile_agents: return True return False |