1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-03-20 06:50:23 +03:00

Refactor support parameters handling in HTML5RDPTransport to use dictionary comprehension for cleaner code

This commit is contained in:
Adolfo Gómez García 2025-02-11 17:05:20 +01:00
parent 3edabec51e
commit a25b510f0e
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -498,13 +498,16 @@ class HTML5RDPTransport(transports.Transport):
if self.smooth.as_bool():
params['enable-font-smoothing'] = 'true'
# if support_params is not empty, add it to the params
# a comma separated list of key=value pairs
if self.support_params.value.strip():
for param in self.support_params.value.split(','):
if '=' in param:
key, value = param.split('=', 1)
params[key.strip()] = value.strip()
# add support params that is a comma separated list of key=value pairs
# ignore empty values or values without '='
params.update(
{
key.strip(): value.strip()
for key, value in (
param.split('=', 1) for param in self.support_params.value.split(',') if '=' in param
)
}
)
logger.debug('RDP Params: %s', params)