mirror of
https://github.com/benbusby/whoogle-search.git
synced 2025-08-11 09:16:23 -04:00
Skip parsing user agent if absent from request
This commit is contained in:
parent
bcb1d8ecc9
commit
b21b4f4f57
@ -157,7 +157,8 @@ class Request:
|
||||
self.language = (
|
||||
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)
|
||||
if not self.mobile:
|
||||
self.modified_user_agent_mobile = gen_user_agent(True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user