Skip to content

Commit

Permalink
chore(view): let developer decide CSP from Helmet
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Jan 5, 2025
1 parent 6e94622 commit 35d4e79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
Expand Down
7 changes: 2 additions & 5 deletions src/context/Response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 35d4e79

Please sign in to comment.