chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
db9509e
)
actix: experiments: Test program: nosniff header
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 19 Mar 2022 19:09:54 +0000
(19:09 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 27 Mar 2022 23:50:26 +0000
(
00:50
+0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/actix-test.rs
patch
|
blob
|
history
diff --git
a/daemon/actix-test.rs
b/daemon/actix-test.rs
index 9feb7118226184d2905d3703832d53733dfe54f9..a17d5c73a338eab2bd8e10ffac6cfb6732fecc24 100644
(file)
--- a/
daemon/actix-test.rs
+++ b/
daemon/actix-test.rs
@@
-7,6
+7,7
@@
use actix_web::HttpRequest;
use actix_web::http::Method;
use actix_web::HttpResponse;
use actix_web::dev::Payload;
+use actix_web::middleware;
use std::convert::Infallible;
@@
-68,6
+69,12
@@
async fn main() -> std::io::Result<()> {
.service(index)
.service(foo)
.default_service(web::to(not_found_handler))
+ .wrap(
+middleware::DefaultHeaders::new().add((
+ actix_web::http::header::X_CONTENT_TYPE_OPTIONS,
+ "nosniff"
+))
+ )
)
.bind(("127.0.0.1", 8080))?
.run()