Skip to content

Commit

Permalink
chore(view): disable csp
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Jan 4, 2025
1 parent 383678d commit bca79f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.15.0",
"version": "5.16.0",
"description": "The Athenna Http server. Built on top of fastify.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down
7 changes: 5 additions & 2 deletions src/context/Response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ export class Response {
.share({ request: this.request })
.render(view, data)

await this.safeHeader('Content-Type', 'text/html; charset=utf-8').send(
content
await this.header(
'Content-Security-Policy',
"default-src 'self' 'unsafe-inline'"
)
.safeHeader('Content-Type', 'text/html; charset=utf-8')
.send(content)

this.response.body = content

Expand Down

0 comments on commit bca79f0

Please sign in to comment.