Function robotxt::create_url

source ·
pub fn create_url(path: &Url) -> Result<Url>
Expand description

Returns the expected path to the robots.txt file as the url::Url.

use url::Url;
use robotxt::create_url;

let path = "https://user:pass@example.com/foo/sample.txt";
let path = Url::parse(path).unwrap();
let robots = create_url(&path).unwrap().to_string();
assert_eq!(robots, "https://example.com/robots.txt")