Merge pull request #35 from Y2Z/verbose

Add basic verbose output
This commit is contained in:
Vincent Flyson 2019-08-24 14:27:23 -04:00 committed by GitHub
commit 008521f72f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

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