From 9e57d512e55bc1725f7e2a53aa7de3b4eca1ff45 Mon Sep 17 00:00:00 2001 From: alma Date: Sat, 24 May 2025 18:46:12 +0200 Subject: [PATCH] W n8n attention vm --- app/api/missions/image/[...path]/route.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/api/missions/image/[...path]/route.ts b/app/api/missions/image/[...path]/route.ts index ccd482d2..6ade181d 100644 --- a/app/api/missions/image/[...path]/route.ts +++ b/app/api/missions/image/[...path]/route.ts @@ -60,11 +60,21 @@ export async function GET( } // Set appropriate content type and cache control - const contentType = response.ContentType || 'application/octet-stream'; + const contentType = response.ContentType || 'image/png'; // Default to image/png if not specified const headers = new Headers(); headers.set('Content-Type', contentType); headers.set('Cache-Control', 'public, max-age=31536000'); + // Log the response details + console.log('Serving image:', { + path: filePath, + minioPath, + contentType, + contentLength: response.ContentLength, + lastModified: response.LastModified, + etag: response.ETag + }); + return new NextResponse(response.Body as any, { headers }); } catch (error) { console.error('Error fetching file from Minio:', {