fix: pipeline
This commit is contained in:
@@ -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, ' ')}...`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user