disable traceid gen in unsecure context (#11349) (#11350)

(cherry picked from commit b8cf2db68e)

Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
github-actions[bot] 2026-02-17 10:47:32 +11:00 committed by GitHub
parent 9b11cd294e
commit eb413bcc57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -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;