refactor(header): Host header internals made private
This allows us to improve the performance. For now, a Cow is used internally, so clients can set the host to a static value and no longer need copies. Later, we can change it to also possibly have a MemSlice. BREAKING CHANGE: The fields of the `Host` header are no longer available. Use the getter methods instead.
This commit is contained in:
@@ -123,10 +123,7 @@ impl<C: Connect> Service for Client<C> {
|
||||
|
||||
let (mut head, body) = request::split(req);
|
||||
let mut headers = Headers::new();
|
||||
headers.set(Host {
|
||||
hostname: url.host_str().unwrap().to_owned(),
|
||||
port: url.port().or(None),
|
||||
});
|
||||
headers.set(Host::new(url.host_str().unwrap().to_owned(), url.port()));
|
||||
headers.extend(head.headers.iter());
|
||||
head.subject.1 = RequestUri::AbsolutePath {
|
||||
path: url.path().to_owned(),
|
||||
|
||||
Reference in New Issue
Block a user