fix: pipeline

This commit is contained in:
2026-02-16 23:08:12 +01:00
parent a2e1cc9850
commit c76c91928f
3 changed files with 12 additions and 9 deletions

View File

@@ -22,17 +22,20 @@ async function verifyImage(path: string): Promise<boolean> {
console.log(`Checking ${url}...`);
if (response.status !== 200) {
throw new Error(`Status: ${response.status}`);
}
const body = await response.text();
const contentType = response.headers.get('content-type');
if (!contentType?.includes('image/png')) {
const body = await response.text();
if (response.status !== 200) {
console.log(` Headers: ${JSON.stringify(Object.fromEntries(response.headers))}`);
console.log(` Status Text: ${response.statusText}`);
throw new Error(
`Status: ${response.status}. Content-Type: ${contentType}. Body preview: ${body.substring(0, 1000).replace(/\n/g, ' ')}...`,
`Status: ${response.status}. Body preview: ${body.substring(0, 1000).replace(/\n/g, ' ')}...`,
);
}
if (!contentType?.includes('image/png')) {
throw new Error(
`Content-Type: ${contentType}. Body preview: ${body.substring(0, 1000).replace(/\n/g, ' ')}...`,
);
}