docs(web): tweak docs for `full_url` (#4032)

This commit is contained in:
Yuki Okushi 2026-04-19 02:37:37 +09:00 committed by GitHub
parent 8c397f83a3
commit 71d6bdf03e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions

View File

@ -89,7 +89,10 @@ impl HttpRequest {
} }
/// This method returns mutable reference to the request head. /// This method returns mutable reference to the request head.
/// panics if multiple references of HTTP request exists. ///
/// # Panics
///
/// Panics if multiple references of HTTP request exists.
#[inline] #[inline]
pub(crate) fn head_mut(&mut self) -> &mut RequestHead { pub(crate) fn head_mut(&mut self) -> &mut RequestHead {
&mut Rc::get_mut(&mut self.inner).unwrap().head &mut Rc::get_mut(&mut self.inner).unwrap().head
@ -106,6 +109,12 @@ impl HttpRequest {
/// Reconstructed URL is best-effort, using [`connection_info`](HttpRequest::connection_info()) /// Reconstructed URL is best-effort, using [`connection_info`](HttpRequest::connection_info())
/// to get forwarded scheme & host. /// to get forwarded scheme & host.
/// ///
/// # Panics
///
/// Panics when the reconstructed URL cannot be parsed, such as when the host is malformed.
///
/// # Examples
///
/// ``` /// ```
/// use actix_web::test::TestRequest; /// use actix_web::test::TestRequest;
/// let req = TestRequest::with_uri("http://10.1.2.3:8443/api?id=4&name=foo") /// let req = TestRequest::with_uri("http://10.1.2.3:8443/api?id=4&name=foo")