Skip to content

Commit aebc064

Browse files
test: probe-image workaround
1 parent 93cbe32 commit aebc064

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

utils/get-image-dimensions.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const defaultDimensions = { width: 600, height: 400 };
55

66
const getImageDimensions = async (url, description) => {
77
try {
8+
if (url.startsWith('data:'))
9+
throw new Error('Data URI images are not supported');
810
let imageDimensions = getCache(url);
911
if (imageDimensions) return imageDimensions;
1012

@@ -17,7 +19,7 @@ const getImageDimensions = async (url, description) => {
1719

1820
return imageDimensions;
1921
} catch (err) {
20-
if (err.statusCode) errorLogger({ type: 'image', name: description }); // Only write HTTP status code errors to log
22+
errorLogger({ type: 'image', name: description });
2123

2224
return defaultDimensions;
2325
}

0 commit comments

Comments
 (0)