Skip to content

Commit

Permalink
Enable helmet
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Sep 22, 2022
1 parent 4fa7ab8 commit c1d5c26
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@fastify/cookie": "^8.0.0",
"@fastify/cors": "^8.0.0",
"@fastify/env": "^4.0.0",
"@fastify/helmet": "^10.0.0",
"@fastify/jwt": "^6.1.0",
"@fastify/postgres": "^5.0.0",
"@fastify/rate-limit": "^7.0.0",
Expand Down
21 changes: 21 additions & 0 deletions plugins/helmet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import fp from 'fastify-plugin'

/**
* This plugins adds fastify/fastify-helmet
*
* @see https://github.com/fastify/fastify-helmet
*/
export default fp(async function (fastify, opts) {
fastify.register(import('@fastify/helmet'), fastify.config.ENV === 'production'
? null
: {
contentSecurityPolicy: {
directives: {
'upgrade-insecure-requests': null
}
}
})
}, {
name: 'helmet',
dependencies: ['env']
})
3 changes: 1 addition & 2 deletions web/components/episode-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const episodeTitle = Component(({
episode: e,
small
} = {}) => {
console.log(e)
const href = small === true
? `/episodes/?id=${e.id}`
: e.url
Expand Down Expand Up @@ -38,7 +37,7 @@ export const episodeTitle = Component(({
? '💿'
: null
}
<a class="bc-episode-title" href="${href}" target="_blank">
<a class="bc-episode-title-text" href="${href}" target="_blank">
${e.display_title}
</a>
</div>
Expand Down

0 comments on commit c1d5c26

Please sign in to comment.