-
Notifications
You must be signed in to change notification settings - Fork 911
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
[Bug] DuckDuckGo fails to download a file from one-time links #5164
Comments
Thank you for opening an Issue in our Repository. |
I've been testing this scenario, and you are right, there are 2 /get request.
My assumption is we are limited to the webview api here compared to other browsers. Will share this internally in case we can think about an approach. |
@cmonfortep Thanks for the response! I understand now, why sending a What would you recommend to implement on the server side to make the site working in DuckDuckGO? Would the following approach work?
This seems as ad-hoc solution and it will fail in the future, if DDG starts downloading the data from the first request. However I don't see a better approach. What do you think? What is a good way to distinguish the first request? Maybe header |
Yes, using X-Requested-With should be fine for this purpose as it's something WebView includes. |
Describe the bug
I have a site which hosts one-time links: https://pastacity.nl/?tab=file
After a file (e.g. PDF) is uploaded, it can be downloaded only once, by design of the site. (This is used a simple solution to share with some degree of privacy.)
This approach works well in many browsers, e.g. Firefox and Chrome both on PC and on mobile, but DuckDuckGo fails to download a file from such a link. The reason is that it sends two HTTP requests, both GET. The first GET request causes the link to expire and the second request (actual file download) is not working:
I think, DuckDuckGo should send the first request as HEAD, because it is a probing request, not expecting to download real data. Then my site (and similar sites) can distinguish the first request as a probe and to prevent data expiry so the second (real) request can successfully download it.
This issue was originally reported to the repo hosting the site: starius/pasta#8 (comment)
How to Reproduce
In DuckDuckGo on Android:
Expected behavior
The file is downloaded back to your phone. (This actually works in other browsers.)
Environment
The text was updated successfully, but these errors were encountered: