Skip to content

Commit

Permalink
change header name, this is no longer a uuid
Browse files Browse the repository at this point in the history
Signed-off-by: Diana Barsan <[email protected]>
  • Loading branch information
dianabarsan committed Nov 7, 2024
1 parent 64b6e99 commit ce74cec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion haproxy/default_frontend.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions tests/integration/api/server.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
};
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit ce74cec

Please sign in to comment.