mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 22:43:31 +02:00
Fix #8820 (Accessing Content Server from iPad gives mobile view of ebook catalog)
This commit is contained in:
parent
34d32fe464
commit
d9a5b3c3c0
2 changed files with 5 additions and 1 deletions
|
|
@ -125,7 +125,7 @@ def index(self, **kwargs):
|
|||
ua.startswith('Stanza')
|
||||
|
||||
# A better search would be great
|
||||
want_mobile = self.MOBILE_UA.search(ua) is not None
|
||||
want_mobile = self.is_mobile_browser(ua)
|
||||
if self.opts.develop and not want_mobile:
|
||||
cherrypy.log('User agent: '+ua)
|
||||
|
||||
|
|
|
|||
|
|
@ -169,6 +169,10 @@ class MobileServer(object):
|
|||
|
||||
MOBILE_UA = re.compile('(?i)(?:iPhone|Opera Mini|NetFront|webOS|Mobile|Android|imode|DoCoMo|Minimo|Blackberry|MIDP|Symbian|HD2|Kindle)')
|
||||
|
||||
def is_mobile_browser(self, ua):
|
||||
match = self.MOBILE_UA.search(ua)
|
||||
return match is not None and 'iPad' not in ua
|
||||
|
||||
def add_routes(self, connect):
|
||||
connect('mobile', '/mobile', self.mobile)
|
||||
connect('mobile_css', '/mobile/style.css', self.mobile_css)
|
||||
|
|
|
|||
Loading…
Reference in a new issue