diff --git a/app/api/missions/image/[...path]/route.ts b/app/api/missions/image/[...path]/route.ts index bcca65c2..80589010 100644 --- a/app/api/missions/image/[...path]/route.ts +++ b/app/api/missions/image/[...path]/route.ts @@ -34,11 +34,12 @@ export async function GET( segments: pathSegments }); - // Use the path as is, since n8n already includes the missions/ prefix - const minioPath = filePath; + // Remove any duplicate missions/ prefix + const minioPath = filePath.replace(/^missions\/missions\//, 'missions/'); console.log('Full Minio path:', { minioPath, - bucket: 'missions' + bucket: 'missions', + endpoint: process.env.MINIO_S3_UPLOAD_BUCKET_URL }); const command = new GetObjectCommand({ @@ -71,6 +72,7 @@ export async function GET( path: filePath, minioPath, bucket: 'missions', + endpoint: process.env.MINIO_S3_UPLOAD_BUCKET_URL, errorType: error instanceof NoSuchKey ? 'NoSuchKey' : 'Unknown' }); if (error instanceof NoSuchKey) {