fix: Do not pass the user_agent if a device_name is set

Fix https://github.com/Lookyloo/lookyloo/issues/556
pull/557/head
Raphaël Vinot 2022-12-02 09:57:51 +01:00
parent 3189be01dc
commit eecff2cd9b
1 changed files with 2 additions and 1 deletions

View File

@ -467,7 +467,8 @@ class Lookyloo():
if not user_agent:
# Catch case where the UA is broken on the UI, and the async submission.
self.user_agents.user_agents # triggers an update of the default UAs
query['user_agent'] = user_agent if user_agent else self.user_agents.default['useragent']
if 'device_name' not in query:
query['user_agent'] = user_agent if user_agent else self.user_agents.default['useragent']
# NOTE: the document must be base64 encoded
document = query.pop('document', None)