Use GET request as some host do not allow HEAD requests

This commit is contained in:
Hongbo Wu 2022-09-28 20:18:40 +08:00
parent a55ad135fd
commit 2f6b26d21d

View file

@ -627,7 +627,7 @@ export const fetchFavicon = async (
): Promise<string | undefined> => {
try {
// get the correct url if it's a redirect
const response = await axios.head(url, { timeout: 5000 })
const response = await axios.get(url, { timeout: 5000 })
const realUrl = response.request.res.responseUrl
const domain = new URL(realUrl).hostname
return `https://api.faviconkit.com/${domain}/32`