Skip to content

Commit c77567a

Browse files
committed
allow setting csp from config
1 parent bfdcc85 commit c77567a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/render.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ impl<'a, W: std::io::Write> HeaderContext<W> {
4242
pub fn new(app_state: Arc<AppState>, request_context: RequestContext, writer: W) -> Self {
4343
let mut response = HttpResponseBuilder::new(StatusCode::OK);
4444
response.content_type("text/html; charset=utf-8");
45-
response.insert_header(&request_context.content_security_policy);
45+
if app_state.config.content_security_policy.is_none() {
46+
response.insert_header(&request_context.content_security_policy);
47+
}
4648
Self {
4749
app_state,
4850
request_context,

0 commit comments

Comments
 (0)