Skip to content

Commit

Permalink
Make sure, that the input url ends with a slash
Browse files Browse the repository at this point in the history
  • Loading branch information
stmh committed Dec 22, 2023
1 parent 42b15ac commit ab42af5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ fn validate_authentication(s: &str) -> Result<String, String> {
}

fn build_sitemap_url(args: &Args, sitemap_name: &str) -> anyhow::Result<Url> {
let base_url = Url::parse(&args.url).expect("Failed to parse base URL");
let mut url_str = args.url.clone();
if !url_str.ends_with('/') {
url_str.push('/');
}
let base_url = Url::parse(&url_str).expect("Failed to parse base URL");

let mut full_url = base_url.join(sitemap_name).expect("Failed to join URL");

Expand Down

0 comments on commit ab42af5

Please sign in to comment.