From c480fcb70f8d7d82225bdf022458d5453116ada1 Mon Sep 17 00:00:00 2001 From: Vincent Flyson Date: Sat, 24 Aug 2019 13:33:24 -0400 Subject: [PATCH] Add basic verbose output --- src/http.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/http.rs b/src/http.rs index 319b98b..165c6f2 100644 --- a/src/http.rs +++ b/src/http.rs @@ -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