From 35d4e79295b71cc5d8b8655b59eb435fa193fe2f Mon Sep 17 00:00:00 2001 From: jlenon7 Date: Sun, 5 Jan 2025 12:38:26 -0300 Subject: [PATCH] chore(view): let developer decide CSP from Helmet --- package.json | 2 +- src/context/Response.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 93d8651..70c40f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/http", - "version": "5.17.0", + "version": "5.18.0", "description": "The Athenna Http server. Built on top of fastify.", "license": "MIT", "author": "João Lenon ", diff --git a/src/context/Response.ts b/src/context/Response.ts index d37d313..bf2c51b 100644 --- a/src/context/Response.ts +++ b/src/context/Response.ts @@ -122,12 +122,9 @@ export class Response { .share({ request: this.request }) .render(view, data) - await this.header( - 'Content-Security-Policy', - "default-src 'self' 'unsafe-inline' 'unsafe-eval' 'img-src' 'style-src-elem' 'script-src-elem'" + await this.safeHeader('Content-Type', 'text/html; charset=utf-8').send( + content ) - .safeHeader('Content-Type', 'text/html; charset=utf-8') - .send(content) this.response.body = content