Skip to content

Commit

Permalink
fix: redoc complains on csp violation
Browse files Browse the repository at this point in the history
  • Loading branch information
mashpie authored and SkeLLLa committed Dec 6, 2020
1 parent c579091 commit 6460989
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ async function oasRoutes(fastify, options) {
},
});
const swaggerCspHeader =
"script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline' data: ; object-src 'none'";
"script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline' data: ; object-src 'none'; worker-src 'self' blob:;";

fastify.register(fstatic, {
setHeaders: (res) => {
res.setHeader('Content-Security-Policy', swaggerCspHeader);
Expand Down

0 comments on commit 6460989

Please sign in to comment.