MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / buildCsp

Function buildCsp

console/contentSecurityPolicy.js:161–173  ·  view source on GitHub ↗
(sentryRelease, sentryEnvironment)

Source from the content-addressed store, hash-verified

159 * @param {string | undefined} sentryEnvironment
160 */
161export function buildCsp(sentryRelease, sentryEnvironment) {
162 const builtCsp = structuredClone(csp);
163 if (sentryEnvironment !== undefined && sentryRelease !== undefined) {
164 builtCsp["report-uri"] = [
165 `https://o561021.ingest.us.sentry.io/api/5699757/security/?sentry_key=13c8b3a8d1e547c9b9493de997b04337&sentry_environment=${sentryEnvironment}&sentry_release=${sentryRelease}`,
166 ];
167 }
168 const directives = Object.entries(builtCsp).map(
169 ([key, values]) => `${key} ${values.join(" ")}`,
170 );
171
172 return directives.join("; ");
173}

Callers 1

writeCspFunction · 0.90

Calls 3

mapMethod · 0.45
entriesMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected