Skip to content
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

"Download video" button will download the content of an HTTP error #27861

Closed
richvdh opened this issue Jul 26, 2024 · 3 comments · Fixed by matrix-org/matrix-react-sdk#12848
Closed
Assignees
Labels
A-File-Download A-Media O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@richvdh
Copy link
Member

richvdh commented Jul 26, 2024

Suppose the media repository is having a bad day, and returning 500 errors; or that the video you are looking for has been removed/was never correctly uploaded.

  1. Click the download button on a video:
    image
  2. Save the file to disk
  3. Inspect the file

Observe that the content is, in fact, the body of the HTTP error ({"errcode":"M_NOT_FOUND","error":"Not found"} or similar).

@richvdh richvdh added T-Defect S-Minor Impairs non-critical functionality or suitable workarounds exist A-Media O-Occasional Affects or can be seen by some users regularly or most users rarely labels Jul 26, 2024
@t3chguy
Copy link
Member

t3chguy commented Jul 26, 2024

Downloads are handled by the browser based on the headers on the resource. Can you confirm what Content-Disposition header this 500 M_NOT_FOUND (shouldn't that be a 404?) contained?

@richvdh
Copy link
Member Author

richvdh commented Jul 26, 2024

(shouldn't that be a 404?)

The behaviour is the same whether it is a 404 or 500.

Can you confirm what Content-Disposition header this 500 M_NOT_FOUND (shouldn't that be a 404?) contained?

None, afaict.

@richvdh richvdh removed the X-Needs-Info This issue is blocked awaiting information from the reporter label Jul 26, 2024
@t3chguy
Copy link
Member

t3chguy commented Jul 26, 2024

Turns out this download button does not levy the browser's download mechanics and does load the entire blob into memory and spit it out from there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-File-Download A-Media O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants