Skip to content

Commit f1f1cf8

Browse files
committed
use constants for header-names in axum CSP middleware
1 parent 380789c commit f1f1cf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/web/csp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ pub(crate) async fn csp_middleware<B>(mut req: AxumHttpRequest<B>, next: Next<B>
172172
// actually enforcing them. This is useful to check if the CSP works without
173173
// impacting production traffic.
174174
if csp_report_only {
175-
"Content-Security-Policy-Report-Only"
175+
http::header::CONTENT_SECURITY_POLICY_REPORT_ONLY
176176
} else {
177-
"Content-Security-Policy"
177+
http::header::CONTENT_SECURITY_POLICY
178178
},
179179
rendered
180180
.parse()

0 commit comments

Comments
 (0)