mirror of https://github.com/fafhrd91/actix-web
implemented function which returns full uir
This commit is contained in:
parent
b4fcdffdc3
commit
3b9c694928
|
@ -91,6 +91,18 @@ impl HttpRequest {
|
|||
&self.head().uri
|
||||
}
|
||||
|
||||
/// Request's full uri (scheme + host + origin).
|
||||
#[inline]
|
||||
pub fn full_uri(&self) -> Uri {
|
||||
let uri: Uri = Uri::builder()
|
||||
.scheme(self.connection_info().scheme())
|
||||
.authority(self.connection_info().host())
|
||||
.path_and_query(self.uri().to_string())
|
||||
.build()
|
||||
.unwrap();
|
||||
uri
|
||||
}
|
||||
|
||||
/// Read the Request method.
|
||||
#[inline]
|
||||
pub fn method(&self) -> &Method {
|
||||
|
|
Loading…
Reference in New Issue