Skip to content

Commit

Permalink
feat(site): add security headers
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Aug 26, 2024
1 parent c371ff8 commit 3e3786e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { useCDNHeaders } from '#nuxt-multi-cache/composables'

export default defineEventHandler((event) => {
const url = event.node.req.url;

event.node.res.setHeader("X-Frame-Options", "DENY");
event.node.res.setHeader("X-Content-Type-Options", "nosniff");

if (url.startsWith("/api/_content/")) {
event.node.res.setHeader("Cache-Control", "public, max-age=604800, immutable");
}
Expand Down

0 comments on commit 3e3786e

Please sign in to comment.