Skip to content

Add ContentType to s3.send#12

Open
KevinPayravi wants to merge 1 commit into
mainfrom
add-content-type
Open

Add ContentType to s3.send#12
KevinPayravi wants to merge 1 commit into
mainfrom
add-content-type

Conversation

@KevinPayravi
Copy link
Copy Markdown
Member

@KevinPayravi KevinPayravi commented May 9, 2026

When uploading thumbnails to S3, no ContentType value was provided. This causes the ContentType to default to application/octet-stream.

This can cause downstream issues, if that content type makes it all the way to an enduser (e.g. if a user views a thumbnail directly, the browser may prompt them to download the file instead of simply displaying it).

This PR adds ContentType: "image/jpeg" to the s3.send command.

@KevinPayravi KevinPayravi requested a review from DominicBM May 9, 2026 03:01
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Review Change Stack

Walkthrough

The Lambda thumbnail generator now explicitly sets ContentType: "image/jpeg" when uploading resized thumbnails to S3. This ensures the stored objects carry the correct MIME type metadata in the dpla-thumbnails bucket. Download, resize, and error handling flows remain unchanged.

Changes

S3 Upload Configuration

Layer / File(s) Summary
S3 Upload ContentType
thumbnailer/app.mjs
PutObjectCommand now includes ContentType: "image/jpeg" parameter for thumbnail uploads.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add ContentType to s3.send' directly and specifically describes the main change: adding ContentType metadata to the S3 upload operation for thumbnails.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-content-type

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@DominicBM DominicBM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants