Add basic verbose output

This commit is contained in:
Vincent Flyson 2019-08-24 13:33:24 -04:00
parent e2ab05a323
commit c480fcb70f

View file

@ -41,7 +41,6 @@ pub fn retrieve_asset(
Ok(url.to_string())
} else {
let client = Client::builder()
.redirect(RedirectPolicy::limited(3))
.timeout(Duration::from_secs(10))
.build()
.unwrap();
@ -50,6 +49,13 @@ pub fn retrieve_asset(
.header(USER_AGENT, opt_user_agent)
.send()
.unwrap();
let final_url = response.url().as_str();
if url == final_url {
eprintln!("[ {} ]", &url);
} else {
eprintln!("[ {} -> {} ]", &url, &final_url);
}
if as_dataurl {
// Convert response into a byte array