diff --git a/p/dbnav/header.js b/p/dbnav/header.js index 1df515a3..f81ecd91 100644 --- a/p/dbnav/header.js +++ b/p/dbnav/header.js @@ -1,6 +1,8 @@ +import { v4 as uuidv4 } from 'uuid'; + const getHeaders = (contentType) => { return { - 'X-Correlation-ID': 'null', + 'X-Correlation-ID': uuidv4()+'_'+uuidv4(), 'Accept': contentType, 'Content-Type': contentType, }; diff --git a/package-lock.json b/package-lock.json index 9ed4c8d1..5e09edee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,8 @@ "lodash": "^4.17.5", "luxon": "^3.1.1", "qs": "^6.6.0", - "slugg": "^1.2.0" + "slugg": "^1.2.0", + "uuid": "^11.0.5" }, "devDependencies": { "@pollyjs/adapter-node-http": "^6.0.5", @@ -1272,6 +1273,15 @@ "node": ">=16.17" } }, + "node_modules/@tapjs/processinfo/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@tapjs/reporter": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/@tapjs/reporter/-/reporter-2.0.8.tgz", @@ -7931,12 +7941,15 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz", + "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist/esm/bin/uuid" } }, "node_modules/v8-compile-cache-lib": { diff --git a/package.json b/package.json index 59a63783..109a24c8 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,8 @@ "lodash": "^4.17.5", "luxon": "^3.1.1", "qs": "^6.6.0", - "slugg": "^1.2.0" + "slugg": "^1.2.0", + "uuid": "^11.0.5" }, "devDependencies": { "@pollyjs/adapter-node-http": "^6.0.5", diff --git a/test/e2e/lib/util.js b/test/e2e/lib/util.js index 58cb59e6..d41f1376 100644 --- a/test/e2e/lib/util.js +++ b/test/e2e/lib/util.js @@ -126,6 +126,12 @@ if (process.env.VCR_MODE && !process.env.VCR_OFF) { }, }, }); + // using exclude above would still require re-recording everything... + polly.server.any().on('request', req => { + if (req.hasHeader('X-Correlation-ID')) { + req.setHeader('X-Correlation-ID', ['null']); + } + }); tap.teardown(async () => { await polly.stop();