implemented function which returns full uir

This commit is contained in:
Timo Caktu 2023-08-02 20:09:39 +02:00
parent b4fcdffdc3
commit 3b9c694928
1 changed files with 12 additions and 0 deletions

View File

@ -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 {