diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2022-09-20 14:50:17 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2022-10-27 12:27:53 +0300 |
commit | 5bd0391433234918a71546cacebafd4aeb8412f5 (patch) | |
tree | 5676762ac10ded87464f03af92b18dd2a2904704 | |
parent | 45dba3d137407df7c1ec41b5da4ed862a42612f2 (diff) |
Add env var OWNCLOUD_HTTPLOGGER_NO_REDACT to prevent redaction of logs
-rw-r--r-- | src/libsync/httplogger.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsync/httplogger.cpp b/src/libsync/httplogger.cpp index 31b53e425..4b9cdb6dd 100644 --- a/src/libsync/httplogger.cpp +++ b/src/libsync/httplogger.cpp @@ -66,7 +66,8 @@ void logHttp(const QByteArray &verb, const QString &url, const QByteArray &id, c stream << " " << url << " Header: { "; for (const auto &it : header) { stream << it.first << ": "; - if (it.first == "Authorization") { + static const bool dontRedact = qEnvironmentVariableIsSet("OWNCLOUD_HTTPLOGGER_NO_REDACT"); + if (!dontRedact && it.first == "Authorization") { stream << (it.second.startsWith("Bearer ") ? "Bearer" : "Basic"); stream << " [redacted]"; } else { |