-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Bug] Download request does not send a Referer header #12182
Comments
Checking the actual requests sent there seems to be some other problem as fenix does send the referer header and also receives the correct data in the response. Diff is stable Firefox 68.10.1 vs Fenix Nightly 200709 requests and responses GET https://eu.dl.twrp.me/cedric/twrp-3.4.0-1-cedric.img HTTP/1.1
Host: eu.dl.twrp.me
-User-Agent: Mozilla/5.0 (Android 9; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0
-Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
-Accept-Language: en-US,en;q=0.5
+User-Agent: Mozilla/5.0 (Android 9; Mobile; rv:80.0) Gecko/80.0 Firefox/80.0
+Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
+Accept-Language: en-US
Accept-Encoding: gzip, deflate, br
-Connection: keep-alive
Referer: https://eu.dl.twrp.me/cedric/twrp-3.4.0-1-cedric.img.html
+Connection: keep-alive
Upgrade-Insecure-Requests: 1
+Sec-Fetch-Dest: document
+Sec-Fetch-Mode: navigate
+Sec-Fetch-Site: same-origin
+Cache-Control: max-age=0
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
-Date: Thu, 09 Jul 2020 22:46:01 GMT
+Date: Thu, 09 Jul 2020 22:45:25 GMT
Content-Type: text/plain
Content-Length: 16836608
Connection: keep-alive
Last-Modified: Mon, 29 Jun 2020 14:55:15 GMT
ETag: "5efa00d3-100e800"
-Expires: Thu, 09 Jul 2020 22:46:00 GMT
+Expires: Thu, 09 Jul 2020 22:45:24 GMT
Cache-Control: no-cache
Accept-Ranges: bytes |
@thymoze, I have no idea where you're getting that information from, as this is absolutely not the case. It looks like you're inspecting the first request that is sent before the user clicked on the "Download" button in Fenix' Download panel, which does - as I mentioned in the issue description - have the correct headers set. The request actually doing the download, however, does not. This, for example, is that request in a debugging proxy: |
Huh as a matter of fact, I have both. It first sends the correct request but aborts that and then sends the same broken one with the |
From the original issue report:
So, yeah. ;) |
Oh wow, yeah... Sorry about that. |
Probably duplicate of #7961. |
👋🏽 |
Verified as fixed on Nightly 201110 05:01 (Build #2015774761) GV 84.0a1 from 11/10 with the devices:
@Amejia481 This is not reproducible on the latest Beta 83.0.0-beta.4 GV 83 from 11/9, but it is reproducible on the latest Release 82.1.3 GV 82 from 11/9. I will remove the qa:needed label and close this issue. |
Jup, this works now. Thanks :) |
Thank @ebalazs-sv and @denschub :) |
Steps to reproduce
Expected behavior
File is downloaded and stored.
Actual behavior
"Download failed" message popped up.
This is because the site requires a valid
Referer
for the download. If no referer is present, the site will just present the HTML again.After clicking the link, Fenix makes a request to the download file with the correct headers and then presents the download dialog. On clicking "download", however, a second request is made, this time without the header. This might be related to https://bugzilla.mozilla.org/show_bug.cgi?id=1259472, but since linked bug is old, I figured it might be a good idea to file here.
The server's behavior can be easily validated with
which returns the 16mb large binary file, and
which results in the HTML file being downloaded.
Device information
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: