1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-21 23:56:35 +00:00

Merge pull request #1101 from actix/add-awc-get-head-methods

Add remaining getter methods from private head field
This commit is contained in:
Sven-Hendrik Haase 2019-09-25 10:23:23 +02:00 committed by GitHub
commit 959f7754b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,7 +96,7 @@ impl ClientRequest {
self
}
/// Get HTTP URI of request
/// Get HTTP URI of request.
pub fn get_uri(&self) -> &Uri {
&self.head.uri
}
@ -132,6 +132,16 @@ impl ClientRequest {
self
}
/// Get HTTP version of this request.
pub fn get_version(&self) -> &Version {
&self.head.version
}
/// Get peer address of this request.
pub fn get_peer_addr(&self) -> &Option<net::SocketAddr> {
&self.head.peer_addr
}
#[inline]
/// Returns request's headers.
pub fn headers(&self) -> &HeaderMap {