Url access functions for Request (simpler)

This commit is contained in:
Martin Algesten
2021-03-23 22:18:44 +01:00
parent 8f16b53c19
commit 40e156e2a3
3 changed files with 156 additions and 49 deletions

View File

@@ -229,7 +229,8 @@ fn connect_inner(
let host = unit
.url
.host_str()
.ok_or_else(|| ErrorKind::InvalidUrl.msg("no host in URL"))?;
// This unwrap is ok because Request::parse_url() ensure there is always a host present.
.unwrap();
let url = &unit.url;
let method = &unit.method;
// open socket