Skip to content

Commit

Permalink
feat: allow inline style in csp
Browse files Browse the repository at this point in the history
  • Loading branch information
ozwaldorf committed Oct 12, 2024
1 parent f2596ba commit 7903f50
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fn main(req: Request) -> Result<Response, Error> {
// - deny all frame ancestors
res.set_header(
header::CONTENT_SECURITY_POLICY,
"default-src *; object-src 'none'; script-src 'none'; frame-ancestors 'none'",
"default-src *; style-src * 'unsafe-inline'; object-src 'none'; script-src 'none'; frame-ancestors 'none'",
);

Ok(res)
Expand Down Expand Up @@ -167,6 +167,12 @@ fn handle_get(req: Request) -> Result<Response, Error> {
<head>
<title>no bs pastebin</title>
</head>
<style>
body {
color: #f4f4f4;
background-color: #0b0b0b;
}
</style>
<body>
<pre>"
.to_string()
Expand Down

0 comments on commit 7903f50

Please sign in to comment.