fix(remote_video): reject empty Content-Type on GET#2913
Merged
Conversation
A 200 OK with no Content-Type is a stronger signal of a misbehaving origin than evidence of a real video — and accepting it would let an HTML error page land on disk as a multi-GB asset that the cleanup sweep can't recover (the row still references the file, so it isn't an orphan). Reject with the same ``unexpected Content-Type`` error path so the operator sees an explicit Failed pill and a re-upload affordance. Follow-up to #2912.
|
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.



Issues Fixed
Follow-up to #2912.
Description
The remote-video download task accepted
Content-Type: ''on GET, with the rationale that ffprobe in the chained normalize step would catch any non-video body. But: if the body did write to disk, the row would still reference the file — so the orphan-cleanup sweep wouldn't touch it, leaving an HTML error page sitting on the SD card as a multi-GB ""asset"".A missing Content-Type is a stronger signal of a misbehaving origin than evidence of a real video. Reject it the same way we reject
text/html/application/json— the operator sees an explicit Failed pill with a clear message instead of a row in a half-state._validate_remote_video_responseto accept onlyvideo/*andapplication/octet-stream.test_download_remote_video_asset_empty_content_type_aborts.Checklist