Skip to content

Commit 4394b49

Browse files
authored
Merge pull request #552 from http-rs/fix-unix-tests
Fix unix tests
2 parents cb5cd33 + 97912e5 commit 4394b49

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/unix.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ mod unix_tests {
1717
let server = task::spawn(async move {
1818
let mut app = tide::new();
1919
app.at("/").get(|req: tide::Request<()>| async move {
20-
let mut response = Response::new(StatusCode::Ok);
21-
response.set_body(serde_json::json!({
20+
let mut res = Response::new(StatusCode::Ok);
21+
res.set_body(serde_json::json!({
2222
"peer_addr": req.peer_addr().unwrap(),
2323
"local_addr": req.local_addr().unwrap()
2424
}));
25-
Ok(response)
25+
Ok(res)
2626
});
2727
app.listen_unix(sock_path).await?;
2828
http_types::Result::Ok(())
@@ -31,9 +31,9 @@ mod unix_tests {
3131
let client = task::spawn(async move {
3232
task::sleep(Duration::from_millis(100)).await;
3333
let listener = UnixStream::connect(&sock_path_for_client).await?;
34-
let request = Request::new(Method::Get, Url::parse("http://_/").unwrap());
35-
let response = async_h1::connect(listener, request).await?;
36-
let body: serde_json::Value = response.body_json().await.unwrap();
34+
let req = Request::new(Method::Get, Url::parse("unix://local.socket/").unwrap());
35+
let mut res = async_h1::connect(listener, req).await?;
36+
let body: serde_json::Value = res.body_json().await.unwrap();
3737
assert!(body.get("peer_addr").unwrap().is_string());
3838
assert!(body
3939
.get("local_addr")

0 commit comments

Comments
 (0)