Skip to content

fix(cli): accept text and octet-stream in the upload allowlist - #2813

Open
ryanthegentry wants to merge 1 commit into
block:mainfrom
ryanthegentry:fix/cli-upload-text-mimes
Open

fix(cli): accept text and octet-stream in the upload allowlist#2813
ryanthegentry wants to merge 1 commit into
block:mainfrom
ryanthegentry:fix/cli-upload-text-mimes

Conversation

@ryanthegentry

Copy link
Copy Markdown

buzz upload file rejects any file whose sniffed MIME is not an image or mp4, but it uploads to the relay's BUD-02 /upload endpoint, and that endpoint routes non-media attachments (e.g. docs, archives, text, data) through process_file_upload and stores them. The CLI is stricter than the endpoint it posts to, so a plain-text file the relay would accept fails client-side with "unsupported file type: application/octet-stream" and never leaves the machine.

infer has no plain-text matcher, so a text file arrives at the check as application/octet-stream; that entry is what unblocks it, and text/plain is added alongside for the paths where a text MIME is known.

Adds a unit test asserting both entries so the widening is not silently reverted.

`buzz upload file` rejects any file whose sniffed MIME is not an image or
mp4, but it uploads to the relay's BUD-02 `/upload` endpoint, and that
endpoint routes non-media attachments — docs, archives, text, data — through
`process_file_upload` and stores them. The CLI is stricter than the endpoint
it posts to, so a plain-text file the relay would accept fails client-side
with "unsupported file type: application/octet-stream" and never leaves the
machine.

`infer` has no plain-text matcher, so a text file arrives at the check as
`application/octet-stream`; that entry is what unblocks it, and `text/plain`
is added alongside for the paths where a text MIME is known.

Adds a unit test asserting both entries so the widening is not silently
reverted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant