Fix bug getting Dr. Drang’s favicon.

This commit is contained in:
Brent Simmons 2017-11-25 13:46:48 -08:00
parent 9865bd8e51
commit 8425e9033b

View File

@ -28,7 +28,15 @@ struct FaviconURLFinder {
return
}
let link = faviconURL(homePageURL, data)
// Use the absoluteString of the responses URL instead of the homePageURL,
// since the homePageURL might actually have been redirected.
// Example: Dr. Drangs feed reports the homePageURL as http://www.leancrew.com/all-this
// but it gets redirected to http://www.leancrew.com/all-this/ which is correct.
// This way any relative link to a favicon in the pages metadata
// will be made absolute correctly.
let urlToUse = response.url?.absoluteString ?? homePageURL
let link = faviconURL(urlToUse, data)
callback(link)
}
}