mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Redirect to original image when cloudflare resize is returning an error (#90)
This commit is contained in:
@@ -64,6 +64,10 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
try {
|
||||
const response = await resizeImage(url, options);
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to resize image');
|
||||
}
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
// Redirect to the original image if resizing fails
|
||||
|
||||
Reference in New Issue
Block a user