Skip to content

Commit

Permalink
fix: ensure empty JSON files aren't written to S3 (#4048)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Dec 6, 2024
1 parent d896888 commit d9b70e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.planx.uk/modules/file/service/uploadFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ export function generateFileParams(
ACL: "public-read",
Bucket: process.env.AWS_S3_BUCKET,
Key: key,
Body: file.buffer,
Body: file.buffer || JSON.stringify(file),
ContentDisposition: `inline;filename="${filename}"`,
ContentType: file.mimetype,
ContentType: file.mimetype || "application/json",
};

return {
Expand Down

0 comments on commit d9b70e0

Please sign in to comment.