mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 07:16:17 +08:00
fix: csp preventing new documentation unable to display logo (@fehmer) (#5719)
!nuf
This commit is contained in:
parent
fb45f05c3f
commit
4a55db5284
|
@ -146,6 +146,13 @@ function applyApiRoutes(app: Application): void {
|
|||
recordClientVersion(clientVersion?.toString() ?? "unknown");
|
||||
}
|
||||
|
||||
if (req.path.startsWith("/docs")) {
|
||||
res.setHeader(
|
||||
"Content-Security-Policy",
|
||||
"default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';img-src 'self' monkeytype.com cdn.redoc.ly data:;object-src 'none';script-src 'self' cdn.redoc.ly 'unsafe-inline'; worker-src blob: data;script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"
|
||||
);
|
||||
}
|
||||
|
||||
next();
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue