Skip to content

Commit ce3cc82

Browse files
committed
isahc: simplify setting headers during request
This fixes a bug where duplicate headers would only use one value. Possibly related to http-rs/surf#220
1 parent 5fd65c3 commit ce3cc82

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)