diff --git a/url/src/lib.rs b/url/src/lib.rs index e015acce..2fb26db4 100644 --- a/url/src/lib.rs +++ b/url/src/lib.rs @@ -444,11 +444,16 @@ impl Url { /// let url = base.join("//eve.com/b")?; /// assert_eq!(url.as_str(), "https://eve.com/b"); /// + /// // Input as base url relative special URL + /// let base = Url::parse("https://alice.com/a")?; + /// let url = base.join("/v1/meta")?; + /// assert_eq!(url.as_str(), "https://alice.com/v1/meta"); + /// /// // Input as absolute URL /// let base = Url::parse("https://alice.com/a")?; /// let url = base.join("http://eve.com/b")?; /// assert_eq!(url.as_str(), "http://eve.com/b"); // http instead of https - + /// /// # Ok(()) /// # } /// # run().unwrap();