mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-17 05:24:22 +01:00
csp: use the sentry origin instead of the URL itself
This commit is contained in:
@@ -22,7 +22,12 @@ export const cspMiddleware = (): AppMiddleware => {
|
||||
const connectSrc = ["'self'", 'blob:', origin, `${wsProtocol}//${host}`];
|
||||
|
||||
if (typeof sentryDsn === 'string') {
|
||||
connectSrc.push(sentryDsn);
|
||||
try {
|
||||
const dsn = new URL(sentryDsn);
|
||||
connectSrc.push(dsn.origin);
|
||||
} catch {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
|
||||
const policies = [
|
||||
|
||||
Reference in New Issue
Block a user