Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

refactor(server): call reply object over raw when overwriting header #156

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,11 @@ async function plugin(server, config) {
!res.getHeader("content-type")?.includes("html") &&
!res.getHeader("content-type")?.includes("xml")
) {
res.raw
.setHeader(
"content-security-policy",
"default-src 'self';frame-ancestors 'none'"
)
.removeHeader("x-xss-protection");
res.header(
"content-security-policy",
"default-src 'self';frame-ancestors 'none'"
);
res.raw.removeHeader("x-xss-protection");
}
return res;
})
Expand Down