From 078e541e065d8c4328bcb555da3cdccd07f36b51 Mon Sep 17 00:00:00 2001 From: Laryssa Rocha Date: Tue, 10 Oct 2023 07:00:53 -0300 Subject: [PATCH] fix(worker): replace `Math.random()` with `crypto.randomUUID()` (#1762) --- src/mockServiceWorker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mockServiceWorker.js b/src/mockServiceWorker.js index 41ee9a29d..faa67b6c8 100644 --- a/src/mockServiceWorker.js +++ b/src/mockServiceWorker.js @@ -107,7 +107,7 @@ self.addEventListener('fetch', function (event) { } // Generate unique request ID. - const requestId = Math.random().toString(16).slice(2) + const requestId = crypto.randomUUID() event.respondWith(handleRequest(event, requestId)) })