1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

properly escape URL paths and querystrings for paths in logging settings

This commit is contained in:
Ryan Petrello 2020-04-09 15:21:02 -04:00 committed by Christian Adams
parent b0db2b7bec
commit bb5136cdae

View File

@ -53,7 +53,10 @@ def construct_rsyslog_conf_template(settings=settings):
'healthchecktimeout="20000"',
]
if parsed.path:
params.append(f'restpath="{parsed.path[1:]}"')
path = urlparse.quote(parsed.path[1:])
if parsed.query:
path = f'{path}?{urlparse.quote(parsed.query)}'
params.append(f'restpath="{path}"')
username = getattr(settings, 'LOG_AGGREGATOR_USERNAME', '')
password = getattr(settings, 'LOG_AGGREGATOR_PASSWORD', '')
if username: