Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 02075f4

Browse files
committedAug 23, 2022
Merge branch 'master' of https://github.com/hyperium/hyper into add-ci-check-external-types
2 parents 76ebc78 + 952756b commit 02075f4

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed
 

‎.github/workflows/CI.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ jobs:
261261
command: rustdoc
262262
args: --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links
263263

264-
doc:
264+
check-external-types:
265265
name: Check exposed types
266266
needs: [style, test]
267267
runs-on: ubuntu-latest

‎examples/client.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ async fn fetch_url(url: hyper::Uri) -> Result<()> {
4646
}
4747
});
4848

49-
let req = Request::builder().uri(url).body(Body::empty()).unwrap();
49+
let authority = url.authority().unwrap().clone();
50+
51+
let req = Request::builder()
52+
.uri(url)
53+
.header(hyper::header::HOST, authority.as_str())
54+
.body(Body::empty())?;
55+
5056
let mut res = sender.send_request(req).await?;
5157

5258
println!("Response: {}", res.status());

‎examples/client_json.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ async fn fetch_json(url: hyper::Uri) -> Result<Vec<User>> {
3636
}
3737
});
3838

39+
let authority = url.authority().unwrap().clone();
40+
3941
// Fetch the url...
40-
let req = Request::builder().uri(url).body(Body::empty()).unwrap();
42+
let req = Request::builder()
43+
.uri(url)
44+
.header(hyper::header::HOST, authority.as_str())
45+
.body(Body::empty())?;
46+
4147
let res = sender.send_request(req).await?;
4248

4349
// asynchronously aggregate the chunks of the body

0 commit comments

Comments
 (0)
Please sign in to comment.