misc: prevent stringified WSGIRequest to be sent to journald (#87556)
gitea/hobo/pipeline/head This commit looks good Details

This commit is contained in:
Benjamin Dauvergne 2024-02-28 12:07:33 +01:00
parent c9b19e9306
commit f560c2e1cc
1 changed files with 3 additions and 0 deletions

View File

@ -137,6 +137,9 @@ class JournalHandler(_logging.Handler):
continue
if key in ['threadName', 'processName', 'pathname', 'lineno', 'funcName']:
continue
# prevent logging of WSGIRequest object which attached to the log record
if not isinstance(value, (str, int)):
continue
extras[key.upper()] = value
journal.send(