1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 10:27:42 +02:00

Add block_on_origin_mismatch option to middleware (#287)

Co-authored-by: CapableWeb <capableweb@domain.com>
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
CapableWeb
2022-09-22 01:22:20 +02:00
committed by GitHub
parent 82a100d96c
commit 3b5682c860
6 changed files with 107 additions and 16 deletions

View File

@ -39,6 +39,8 @@ async fn main() -> std::io::Result<()> {
.allowed_header(header::CONTENT_TYPE)
// set list of headers that are safe to expose
.expose_headers(&[header::CONTENT_DISPOSITION])
// allow cURL/HTTPie from working without providing Origin headers
.block_on_origin_mismatch(false)
// set preflight cache TTL
.max_age(3600),
)