Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 14, 2025

Conversation

fioan89
Copy link
Collaborator

@fioan89 fioan89 commented Aug 12, 2025

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
Copy link
Collaborator Author

fioan89 commented Aug 12, 2025

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
Copy link
Member

@code-asher code-asher left a comment

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