mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
fix ssl test
This commit is contained in:
parent
95130fcfd0
commit
effacf8fc8
@ -126,7 +126,7 @@ async fn test_chunked_payload() {
|
|||||||
.take_payload()
|
.take_payload()
|
||||||
.map(|res| match res {
|
.map(|res| match res {
|
||||||
Ok(pl) => pl,
|
Ok(pl) => pl,
|
||||||
Err(e) => panic!(format!("Error reading payload: {}", e)),
|
Err(e) => panic!("Error reading payload: {}", e),
|
||||||
})
|
})
|
||||||
.fold(0usize, |acc, chunk| ready(acc + chunk.len()))
|
.fold(0usize, |acc, chunk| ready(acc + chunk.len()))
|
||||||
.map(|req_size| {
|
.map(|req_size| {
|
||||||
@ -162,7 +162,7 @@ async fn test_chunked_payload() {
|
|||||||
let re = Regex::new(r"size=(\d+)").unwrap();
|
let re = Regex::new(r"size=(\d+)").unwrap();
|
||||||
let size: usize = match re.captures(&data) {
|
let size: usize = match re.captures(&data) {
|
||||||
Some(caps) => caps.get(1).unwrap().as_str().parse().unwrap(),
|
Some(caps) => caps.get(1).unwrap().as_str().parse().unwrap(),
|
||||||
None => panic!(format!("Failed to find size in HTTP Response: {}", data)),
|
None => panic!("Failed to find size in HTTP Response: {}", data),
|
||||||
};
|
};
|
||||||
size
|
size
|
||||||
};
|
};
|
||||||
|
@ -89,7 +89,7 @@ fn ssl_acceptor() -> SslAcceptorBuilder {
|
|||||||
builder.set_certificate(&cert).unwrap();
|
builder.set_certificate(&cert).unwrap();
|
||||||
builder.set_private_key(&key).unwrap();
|
builder.set_private_key(&key).unwrap();
|
||||||
|
|
||||||
Ok(builder)
|
builder
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
|
Loading…
Reference in New Issue
Block a user