Skip to content

Commit

Permalink
Merge pull request rust-lang#132 from SimonSapin/url-1.0
Browse files Browse the repository at this point in the history
Update to rust-url 1.0
  • Loading branch information
alexcrichton committed Apr 28, 2016
2 parents 061a3f2 + 0bd746c commit b8127bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion git2-curl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Intended to be used with the git2 crate.

[dependencies]
curl = "0.2"
url = "0.5"
url = "1.0"
log = "0.3"
git2 = { path = "..", version = "0.4" }

Expand Down
6 changes: 3 additions & 3 deletions git2-curl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ impl CurlSubtransport {
let parsed = try!(Url::parse(&url).map_err(|_| {
self.err("invalid url, failed to parse")
}));
let host = match parsed.host() {
Some(host) => host.to_string(),
let host = match parsed.host_str() {
Some(host) => host,
None => return Err(self.err("invalid url, did not have a host")),
};

Expand All @@ -149,7 +149,7 @@ impl CurlSubtransport {
let mut req = Request::new(&mut h.0, self.method)
.uri(url)
.header("User-Agent", &agent)
.header("Host", &host)
.header("Host", host)
.follow_redirects(true);
if data.len() > 0 {
req = req.body(&mut data)
Expand Down

0 comments on commit b8127bf

Please sign in to comment.