Skip to content

Commit 968a0f1

Browse files
authored
Merge pull request #38 from Fishrock123/simplify-isahc-headers
isahc: simplify setting headers during request
2 parents 5fd65c3 + ce3cc82 commit 968a0f1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/isahc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ impl HttpClient for IsahcClient {
4949
.uri(req.url().as_str())
5050
.method(http::Method::from_bytes(req.method().to_string().as_bytes()).unwrap());
5151

52-
for name in req.header_names() {
53-
if let Some(value) = req.header(name) {
54-
builder = builder.header(name.as_str(), value.as_str());
55-
}
52+
for (name, value) in req.iter() {
53+
builder = builder.header(name.as_str(), value.as_str());
5654
}
5755

5856
let body = req.take_body();

0 commit comments

Comments
 (0)