Open softvision-raul-bucata opened 2 years ago
FYI this is caused by the following being commented out inside DownloadHelper:
// Bug 1474339 - Don't auto-download files served with 'Content-Disposition: attachment'
// Leaving this here for now, but commented out. Checking this HTTP header is
// what Desktop does should we ever decide to change our minds on this.
// let contentDisposition = (response as? HTTPURLResponse)?.allHeaderFields["Content-Disposition"] as? String
// let isAttachment = contentDisposition?.starts(with: "attachment") ?? (mimeType == MIMEType.OctetStream)
guard isAttachment || !canShowInWebView || forceDownload else {
return nil
}
The response does indeed have a contentDisposition starting with "attachment" . Here's the full response:
<NSHTTPURLResponse: 0x292eb9c80> { URL: https://sd.redditsave.com/download.php?permalink=https://reddit.com/r/MadeMeSmile/comments/vu2gc2/hockey_player_thinks_his_penalty_is_bullshit/&video_url=https://v.redd.it/wkvpw0bsy9a91/DASH_720.mp4?source=fallback&audio_url=false } { Status Code: 200, Headers {
"Alt-Svc" = (
"h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"
);
"Cache-Control" = (
"must-revalidate, post-check=0, pre-check=0"
);
"Content-Disposition" = (
"attachment; filename=\"redditsave.com_hockey_player_thinks_his_penalty_is_bullshit-wkvpw0bsy9a91.mp4\""
);
"Content-Length" = (
3345316
);
"Content-Type" = (
"application/octet-stream"
);
Date = (
"Tue, 12 Jul 2022 14:37:23 GMT"
);
Expires = (
0
);
Pragma = (
public
);
"Report-To" = (
"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=Vw3w8QzmzYBTVLZMR63SylMNP1TSbzyQNECPgKYOFbCwcjjRwUUymBUZX4HuwGb%2FEztP3AizGoVxOrVg9OAM9t9ii9NKYJDo%2B7cumQvDzxcFlikBYVU3VkMF9%2BT7V6k0Iix0dQ%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}"
);
Server = (
cloudflare
);
Vary = (
"Accept-Encoding"
);
"cf-cache-status" = (
DYNAMIC
);
"cf-ray" = (
"729a8421e99c7780-LHR"
);
"content-description" = (
"File Transfer"
);
"content-transfer-encoding" = (
Binary
);
"expect-ct" = (
"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""
);
nel = (
"{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}"
);
} }
and the mimeType is video/mp4
FYI - Safari offers to either view or download the file (it also fails to load if viewed)
This issue has been automatically marked as stale. Has the issue been fixed, or does it still require the community's attention? Please leave any comment to keep this issue opened. It will be closed automatically if no further update occurs in the next 30 days. Thank you for your contributions!
This issue still happens as we still do not respect the content disposition header
Steps to reproduce
Expected behavior
A download prompt is triggered.
Actual behavior
A new window opens, with a broken "Play" button.
Device & build information
Notes
Attachments:
Firefox:
Edge:
┆Issue is synchronized with this Jira Task