From ce74ceca2d3a1299de56c51b512d14232a0b13ff Mon Sep 17 00:00:00 2001 From: Diana Barsan Date: Thu, 7 Nov 2024 07:37:31 +0200 Subject: [PATCH] change header name, this is no longer a uuid Signed-off-by: Diana Barsan --- haproxy/default_frontend.cfg | 2 +- tests/integration/api/server.spec.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/haproxy/default_frontend.cfg b/haproxy/default_frontend.cfg index 5e74fd4dd2..2d47f4a1f1 100644 --- a/haproxy/default_frontend.cfg +++ b/haproxy/default_frontend.cfg @@ -63,7 +63,7 @@ frontend http-in http-request capture req.hdr(x-medic-service) len 200 # capture.req.hdr(1) http-request capture req.hdr(x-medic-user) len 200 # capture.req.hdr(2) http-request capture req.hdr(user-agent) len 600 # capture.req.hdr(3) - http-request capture req.hdr(x-request-uuid) len 200 # capture.req.hdr(4) + http-request capture req.hdr(x-request-id) len 12 # capture.req.hdr(4) capture response header Content-Length len 10 # capture.res.hdr(0) http-response set-header Connection Keep-Alive http-response set-header Keep-Alive timeout=18000 diff --git a/tests/integration/api/server.spec.js b/tests/integration/api/server.spec.js index 753e73cb23..16c529221c 100644 --- a/tests/integration/api/server.spec.js +++ b/tests/integration/api/server.spec.js @@ -235,12 +235,11 @@ describe('server', () => { }); describe('Request ID propagated to audit layer', () => { - const ID_REGEX = /[,\s]([0-9a-f]{12})[,\s]/; + const ID_REGEX = /[,|\s]([0-9a-f]{12})[,|\s]/; const getReqId = (logLine) => { if (ID_REGEX.test(logLine)) { const match = logLine.match(ID_REGEX); - console.warn(match); return match?.[1]; } }; @@ -368,7 +367,6 @@ describe('server', () => { const reqID = getReqId(apiLogs[0]); const haproxyRequests = haproxyLogs.filter(entry => getReqId(entry) === reqID); - console.warn(haproxyRequests); expect(haproxyRequests.length).to.equal(12); expect(haproxyRequests[0]).to.include('_session'); expect(haproxyRequests[5]).to.include('/medic-test/_design/medic/_view/contacts_by_depth');