szyb / synopackage_dotnet

This is source code of the page https://synopackage.com - a search engine for third-party packages dedicated to Synology's DSM system. Also act as proxy repository: one link -> all sources. Written in C# & Typescript.
https://synopackage.com
Apache License 2.0
17 stars 3 forks source link

Unable to download SPK package from imnks source #276

Closed szyb closed 2 years ago

szyb commented 2 years ago

error from logs:


   at System.Net.WebRequest.<>c.<GetResponseAsync>b__68_2(IAsyncResult iar)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location ---
   at synopackage_dotnet.Model.Services.DownloadSpkService.IsRemoteFileAvailable(String link) in [cut]\synopackage_dotnet\synopackage_dotnet.model\Model\Services\DownloadSpkService.cs:line 144 System.Net.WebResponse EndGetResponse(System.IAsyncResult)```
szyb commented 2 years ago

There are 2 redirections made: 1) from http to https 2) then to http://dl.imnks.com:8888

need to investigate why this is an issue

szyb commented 2 years ago

Debugging. When I tried to download package via Postman, then the original link is redirected to dl.imnks.com:8888 and the SPK file is downloaded well. But when I use the same link in browser I got following image instead of SPK file cpolar_x64-6 1_3 2 86 16-1

Anyone knows what it is? I guess that this is kind of hotlinking protection, isn't? If yes, than probably downloading packages via synopackage may not be possible

EDIT: This is tricky. Localhost without https: the image is shown. However when I force download by proxy (as it should be in production) then the SPK is downloaded. Production with https: timeout. This leads me to conclusion: maybe our web hosting is blocking such connection (HTTP HEAD, port 8888)? We use HEAD method to check whether the file is available (without downloading it immediately). Or target server drops packets?

Need to investigate further

szyb commented 2 years ago

Now this website does not allow to download packages manually from web browser (only from Package Center). This is the only SPK source that works in that way. Need to: 1) Give a information about problems with downloading pacakges, or/and: 2) Remove download SPK button for both imnks servers.

It's not a bug then... remove the bug label