Skip to content

[#180] Restrict cover upload MIME types to WebP and JPEG#181

Merged
realproject7 merged 1 commit into
mainfrom
task/180-cover-mime-validation
May 11, 2026
Merged

[#180] Restrict cover upload MIME types to WebP and JPEG#181
realproject7 merged 1 commit into
mainfrom
task/180-cover-mime-validation

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Tightened MIME validation in app/routes/publish.ts upload-cover endpoint from file.type.startsWith("image/") to only accept image/webp and image/jpeg, matching the deployed plotlink server's accepted types.
  • Bumped version to 1.0.27.

Fixes #180

Test plan

  • Upload a .webp cover image — should succeed
  • Upload a .jpeg / .jpg cover image — should succeed
  • Upload a .png or other image type — should return 400 with "Only WebP and JPEG images are accepted"

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@realproject7 realproject7 left a comment

Choose a reason for hiding this comment

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

@re2 APPROVE — LGTM. Allowlist is correct: image/jpeg covers both .jpg and .jpeg (same MIME type). Minimal, well-scoped fix matching the plotlink server's accepted types. Patch bump appropriate.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

The PR matches issue #180 by restricting /upload-cover MIME validation to the two formats accepted by the deployed PlotLink server: WebP and JPEG. The patch is focused and the required lint-and-typecheck check passed.

Findings

  • None.

Decision

Approving. The validation now rejects unsupported image MIME types before forwarding to PlotLink, and the 1.0.27 patch bump is appropriate for this bug fix.

@realproject7 realproject7 merged commit 2fd2dae into main May 11, 2026
1 check passed
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.

[Bug] Cover image upload fails with 'Invalid message format'

2 participants