MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / createHeadersSafely

Function createHeadersSafely

packages/browser/src/tracing/utils.ts:39–46  ·  view source on GitHub ↗
(headers: Record<string, string> | undefined)

Source from the content-addressed store, hash-verified

37 * Creates a Headers object from a record of string key-value pairs, and returns undefined if it fails.
38 */
39export function createHeadersSafely(headers: Record<string, string> | undefined): Headers | undefined {
40 try {
41 return new Headers(headers);
42 } catch {
43 // noop
44 return undefined;
45 }
46}

Callers 2

xhrCallbackFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected