From 033bcc0c993d8c5184dc6c340ebf6b694e7da858 Mon Sep 17 00:00:00 2001 From: Ilya Brin <464157+ilyabrin@users.noreply.github.com> Date: Mon, 28 Jul 2025 22:07:55 +0300 Subject: [PATCH] Potential fix for code scanning alert no. 1: Clear-text logging of sensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- logger.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/logger.go b/logger.go index 75da680..9fb12a4 100644 --- a/logger.go +++ b/logger.go @@ -178,7 +178,11 @@ func (l *DiskLogger) LogRequest(method, url string, headers map[string]string) { if l.config.Verbose { for key, value := range headers { sanitizedValue := l.SanitizeValue(key, value) - l.Debug(" Header: %s: %s", key, sanitizedValue) + if sanitizedValue != value { + l.Debug(" Header: %s: %s", key, sanitizedValue) + } else { + l.Debug(" Header: %s: [sanitized]", key) + } } } }