Skip to content

Commit

Permalink
Merge pull request #2269 from ministryofjustice/CAS-1324-remove-uuid-…
Browse files Browse the repository at this point in the history
…dependency-in-place-of-node-crypto

Remove UUID dependency
  • Loading branch information
aliuk2012 authored Dec 31, 2024
2 parents 3304f9a + 4cb0512 commit ac36f62
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 28 deletions.
24 changes: 1 addition & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@
"static-path": "^0.0.4",
"superagent": "^9.0.0",
"underscore": "^1.13.6",
"url-value-parser": "^2.2.0",
"uuid": "^10.0.0"
"url-value-parser": "^2.2.0"
},
"devDependencies": {
"@golevelup/ts-jest": "^0.5.0",
Expand All @@ -187,7 +186,6 @@
"@types/superagent": "^8.0.0",
"@types/supertest": "^6.0.0",
"@types/underscore": "^1.11.4",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"audit-ci": "^7.0.0",
Expand Down
3 changes: 1 addition & 2 deletions server/middleware/setUpWebSession.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { v4 as uuidv4 } from 'uuid'
import session from 'express-session'
import RedisStore from 'connect-redis'
import express, { Router } from 'express'
Expand Down Expand Up @@ -32,7 +31,7 @@ export default function setUpWebSession(): Router {
router.use((req, res, next) => {
const headerName = 'X-Request-Id'
const oldValue = req.get(headerName)
const id = oldValue === undefined ? uuidv4() : oldValue
const id = oldValue === undefined ? crypto.randomUUID() : oldValue

res.set(headerName, id)
req.id = id
Expand Down

0 comments on commit ac36f62

Please sign in to comment.