From a55ad135fd3ce99f4d5f4a167f73add2fd7af366 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Wed, 28 Sep 2022 19:26:42 +0800 Subject: [PATCH] Set 5s for the HEAD request timeout --- packages/api/src/utils/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/src/utils/parser.ts b/packages/api/src/utils/parser.ts index 05f6df6b5..e3abd0e6d 100644 --- a/packages/api/src/utils/parser.ts +++ b/packages/api/src/utils/parser.ts @@ -627,7 +627,7 @@ export const fetchFavicon = async ( ): Promise => { try { // get the correct url if it's a redirect - const response = await axios.head(url) + const response = await axios.head(url, { timeout: 5000 }) const realUrl = response.request.res.responseUrl const domain = new URL(realUrl).hostname return `https://api.faviconkit.com/${domain}/32`