1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-30 16:40:21 +02:00

port cors middleware

This commit is contained in:
Nikolay Kim
2019-03-23 21:29:16 -07:00
parent 60050307bd
commit 5b06f2bee5
5 changed files with 582 additions and 649 deletions

View File

@@ -154,18 +154,15 @@ mod tests {
use super::*;
use crate::dev::ServiceRequest;
use crate::http::header::CONTENT_TYPE;
use crate::test::{block_on, TestRequest};
use crate::test::{block_on, ok_service, TestRequest};
use crate::HttpResponse;
#[test]
fn test_default_headers() {
let srv = FnService::new(|req: ServiceRequest<_>| {
req.into_response(HttpResponse::Ok().finish())
});
let mut mw = block_on(
DefaultHeaders::new()
.header(CONTENT_TYPE, "0001")
.new_transform(srv),
.new_transform(ok_service()),
)
.unwrap();