|
|
@ -160,9 +160,12 @@ fn main() {
|
|
|
|
// Safe to unwrap (we just put this through an HTTP request)
|
|
|
|
// Safe to unwrap (we just put this through an HTTP request)
|
|
|
|
let mut clean_url = Url::parse(&base_url).unwrap();
|
|
|
|
let mut clean_url = Url::parse(&base_url).unwrap();
|
|
|
|
clean_url.set_fragment(None);
|
|
|
|
clean_url.set_fragment(None);
|
|
|
|
// Don't include credentials
|
|
|
|
// Prevent credentials from getting into metadata
|
|
|
|
clean_url.set_username("").unwrap();
|
|
|
|
if is_http_url(&base_url) {
|
|
|
|
clean_url.set_password(None).unwrap();
|
|
|
|
// Only HTTP(S) URLs may feature credentials
|
|
|
|
|
|
|
|
clean_url.set_username("").unwrap();
|
|
|
|
|
|
|
|
clean_url.set_password(None).unwrap();
|
|
|
|
|
|
|
|
}
|
|
|
|
let metadata_comment = if is_http_url(&base_url) {
|
|
|
|
let metadata_comment = if is_http_url(&base_url) {
|
|
|
|
format!(
|
|
|
|
format!(
|
|
|
|
"<!-- Saved from {} at {} using {} v{} -->\n",
|
|
|
|
"<!-- Saved from {} at {} using {} v{} -->\n",
|
|
|
|