Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/probeImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ async function detectErrorType(url, fallbackType) {
if (Number.isInteger(response?.status) && response.status >= 400) {
return String(response.status);
}

// If an <img> onerror fires but HEAD returns non-error status,
// treat it as a non-actionable mismatch and skip.
if (fallbackType === "load") {
return null;
}
} catch {
// Ignore; fallbackType is returned below.
} finally {
Expand Down Expand Up @@ -121,6 +127,7 @@ const probeImage = (url, onError, provider, sourceUrl) => {
if (!cancelled) {
const pageUrl = typeof window !== "undefined" ? window.location?.href || "" : "";
void detectErrorType(url, "load").then((errorType) => {
if (!errorType) return;
reportThumbnailError(url, provider, sourceUrl, pageUrl, errorType);
});
onError();
Expand Down
Loading