From 7d54780cadab76da71cb04bc9c51325772aee4d4 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 2 Dec 2024 06:49:22 +0300 Subject: [PATCH] hide API-Key from appearing on the tx log --- .../java/org/hl7/fhir/r5/context/TextClientLogger.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TextClientLogger.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TextClientLogger.java index 836f528b9..6f2e1fda7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TextClientLogger.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TextClientLogger.java @@ -63,8 +63,13 @@ public class TextClientLogger extends BaseLogger implements ToolingClientLogger file.println("\r\n--- "+id+" -----------------\r\nRequest: \r\n"); file.println(method+" "+url+" HTTP/1.0"); if (headers != null) { - for (String s : headers) - file.println(s); + for (String s : headers) { + if (s.startsWith("Api-Key")) { + file.println("Api-Key: xxxxxxxxxxxxxxxx"); + } else { + file.println(s); + } + } } if (body != null) { file.println("");