mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-05 18:01:14 +00:00
disable traceid gen in unsecure context (#11349)
This commit is contained in:
1 parent
14a2e4c5af
commit
b8cf2db68e
1 file changed
+5
@@ -36,6 +36,11 @@ export const queryClient = new QueryClient({
|
||||
}
|
||||
});
|
||||
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 traceid = `00-${runID}-${frontendID}-01`;
|
||||
api.defaults.headers['traceparent'] = traceid;
|
||||
|
||||
Reference in new issue
Block a user