Skip to content

Commit

Permalink
updated plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
tryb3l committed May 4, 2024
1 parent 6425d04 commit 5dbff03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions plugins/helmet.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ module.exports = fp(async function helmetPlugin(fastify) {
fastify.register(require('@fastify/helmet'), {
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
styleSrc: ["'self'", 'https:', "'unsafe-inline'"],
scriptSrc: ["'self'", 'https:', "'unsafe-inline'"],
imgSrc: ["'self'", 'data:', 'validator.swagger.io'],
scriptSrc: ["'self'", 'trusted-cdn.com', 'https://unpkg.com'], // Adjust the CDN domain if needed
},
},
})
Expand Down
3 changes: 1 addition & 2 deletions plugins/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ const path = require('node:path')
module.exports = fp(
async function staticPlugin(fastify) {
fastify.register(fastifyStatic, {
root: path.join(__dirname, '../public'),
prefix: '/public/',
root: path.join(__dirname, '/public'),
})
},
{
Expand Down

0 comments on commit 5dbff03

Please sign in to comment.