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 a09ad7617d
commit f688768ca7

View File

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