mirror of
https://github.com/inventree/InvenTree.git
synced 2026-03-11 22:54:17 +00:00
(cherry picked from commit b8cf2db68e)
Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
committed by
GitHub
parent
9b11cd294e
commit
eb413bcc57
@@ -36,6 +36,11 @@ export const queryClient = new QueryClient({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
export function setTraceId() {
|
export function setTraceId() {
|
||||||
|
// check if we are in a secure context (https) - if not use of crypto is not allowed
|
||||||
|
if (!window.isSecureContext) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
const runID = crypto.randomUUID().replace(/-/g, '');
|
const runID = crypto.randomUUID().replace(/-/g, '');
|
||||||
const traceid = `00-${runID}-${frontendID}-01`;
|
const traceid = `00-${runID}-${frontendID}-01`;
|
||||||
api.defaults.headers['traceparent'] = traceid;
|
api.defaults.headers['traceparent'] = traceid;
|
||||||
|
|||||||
Reference in New Issue
Block a user