1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-27 15:29:03 +02:00

refactor http service builder

This commit is contained in:
Nikolay Kim
2018-09-26 20:43:54 -07:00
parent 0aa0f326f7
commit 9f1417af30
10 changed files with 435 additions and 355 deletions

View File

@ -1127,12 +1127,23 @@ mod tests {
let resp: HttpResponse = HttpResponse::Ok().into();
let resp = cors.response(&req, resp).unwrap().response();
let origins_str = resp.headers().get(header::ACCESS_CONTROL_ALLOW_ORIGIN).unwrap().to_str().unwrap();
let origins_str = resp
.headers()
.get(header::ACCESS_CONTROL_ALLOW_ORIGIN)
.unwrap()
.to_str()
.unwrap();
if origins_str.starts_with("https://www.example.com") {
assert_eq!("https://www.example.com, https://www.google.com", origins_str);
assert_eq!(
"https://www.example.com, https://www.google.com",
origins_str
);
} else {
assert_eq!("https://www.google.com, https://www.example.com", origins_str);
assert_eq!(
"https://www.google.com, https://www.example.com",
origins_str
);
}
}