Skip parsing user agent if absent from request
parent
bcb1d8ecc9
commit
b21b4f4f57
|
@ -157,7 +157,8 @@ class Request:
|
||||||
self.language = (
|
self.language = (
|
||||||
config.lang_search if config.lang_search else ''
|
config.lang_search if config.lang_search else ''
|
||||||
)
|
)
|
||||||
self.mobile = 'Android' in normal_ua or 'iPhone' in normal_ua
|
self.mobile = bool(normal_ua) and ('Android' in normal_ua
|
||||||
|
or 'iPhone' in normal_ua)
|
||||||
self.modified_user_agent = gen_user_agent(self.mobile)
|
self.modified_user_agent = gen_user_agent(self.mobile)
|
||||||
if not self.mobile:
|
if not self.mobile:
|
||||||
self.modified_user_agent_mobile = gen_user_agent(True)
|
self.modified_user_agent_mobile = gen_user_agent(True)
|
||||||
|
|
Loading…
Reference in New Issue