Repository navigation
feat(upload): allow PDF attachments - #708
Merged
Merged
Conversation
Add .pdf (application/pdf) to the upload allowlist, with the same magic-byte signature check used for images. The composer's file picker, attach-button title and drop zone now advertise PDFs. Every harness already handles non-image attachments by path (and OpenCode sends PDFs as file parts). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.pdf→application/pdfadded to the upload allowlist; PDFs go through the same magic-byte (file-type) signature check as images, so a disguised file is rejected.acceptlist, the attach-button tooltip and the drop-zone label now include PDFs.POST /api/uploadin API-REFERENCE.md.No harness changes needed: Claude and Grok get the path and read the file with their own tools, Codex gets a path reference for non-images, and OpenCode already sends PDFs as data-URL file parts.
Test plan
.pdfcontaining PNG bytes is rejected (signature mismatch)server/upload-routes.test.tspasses (18/18)🤖 Generated with Claude Code