Added custom redirect policy

This commit is contained in:
James Wykeham-Martin 2018-02-02 09:40:13 +00:00
parent 82f577c17d
commit d0c5764471

View File

@ -39,7 +39,8 @@ fn download_into(
) -> Result<String> { ) -> Result<String> {
info!("GET request to: {}", url); info!("GET request to: {}", url);
// Haven't included the loop check as // Haven't included the loop check as
// Steal the Stars // Steal the Stars would tigger it as
// it has a loop back before giving correct url
let policy = RedirectPolicy::custom(|attempt| { let policy = RedirectPolicy::custom(|attempt| {
info!("Redirect Attempt URL: {:?}", attempt.url()); info!("Redirect Attempt URL: {:?}", attempt.url());
if attempt.previous().len() > 10 { if attempt.previous().len() > 10 {