Skip to content

fix: enforce Content-Type to accept only binary responses#174

Merged
fioan89 merged 3 commits into
mainfrom
fix-enforce-content-type-when-downloading-cli
Aug 14, 2025
Merged

fix: enforce Content-Type to accept only binary responses#174
fioan89 merged 3 commits into
mainfrom
fix-enforce-content-type-when-downloading-cli

Conversation

@fioan89

@fioan89 fioan89 commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator

Add validation for CLI downloads that ensures the Content-Type header is indicating a binary stream (application/octet-stream), including common variants with parameters. This prevents saving unexpected HTML or other non-binary responses (e.g., from frontend dev servers on :8080) as binaries, improving reliability and providing clearer error feedback.

Add validation for CLI downloads that ensures the Content-Type header
is indicating a binary stream (`application/octet-stream`),
including common variants with parameters. This prevents saving unexpected
HTML or other non-binary responses (e.g., from frontend dev servers on :8080)
as binaries, improving reliability and providing clearer error feedback.
@fioan89

fioan89 commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator Author
image

I think this provides a better message compared to the previous message which hided the actual issue (html page downloaded into a file with the name of the cli, with the fake cli failing to execute)

which now expect Content-Type to be present on the response

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@fioan89 fioan89 merged commit a923f58 into main Aug 14, 2025
6 checks passed
@fioan89 fioan89 deleted the fix-enforce-content-type-when-downloading-cli branch August 14, 2025 19:17
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