mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-03-14 05:53:39 +00:00
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:
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user