Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2076b8f

Browse files
committedMar 25, 2025·
fix: add options to probe-image-size to reduce timeouts, and not follow redirects
1 parent 66188f5 commit 2076b8f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎utils/get-image-dimensions.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ const getImageDimensions = async (url, description) => {
1818
const cachedDimensions = getCache(url);
1919
if (cachedDimensions) imageDimensions = cachedDimensions;
2020

21-
const fetchedImageDimensions = await probe(url);
21+
const fetchedImageDimensions = await probe(url, {
22+
open_timeout: 5000,
23+
response_timeout: 5000,
24+
read_timeout: 5000,
25+
// Don't follow redirects, which can
26+
// cause some localized builds to hang
27+
follow_max: 0
28+
});
2229
imageDimensions = {
2330
width: fetchedImageDimensions?.width
2431
? fetchedImageDimensions?.width

0 commit comments

Comments
 (0)
Please sign in to comment.