fix: fallback to timestamp in case if crypto context is not available

Previous tests have been done in either secure (HTTPS) or loopback
(localhost) environments, so I missed the case, that crypto methods
might not be available

Fixes #159
This commit is contained in:
2026-03-13 16:29:05 +02:00
parent cc082dbd6f
commit 34d0b8cf73

View File

@@ -40,7 +40,7 @@ export class Client {
const headers: Record<string, string> = {
Accept: "application/json",
"X-Request-ID": crypto.randomUUID(),
"X-Request-ID": crypto.randomUUID?.() ?? Date.now().toString(),
};
if (json !== undefined) {
headers["Content-Type"] = "application/json";