Support downloading from http
Add http support to downloads(ws:// connections and uploads already work, this is just fixing the downloads)
This commit is contained in:
@@ -55,7 +55,12 @@ namespace MareSynchronos.WebAPI
|
||||
wc.DownloadProgressChanged += progChanged;
|
||||
|
||||
string fileName = Path.GetTempFileName();
|
||||
var baseUri = new Uri(ApiUri.Replace("wss", "https"), UriKind.Absolute);
|
||||
Uri baseUri;
|
||||
if (ApiUri.StartsWith("ws://")) { // Bad bad bad but yeah
|
||||
baseUri = new Uri(ApiUri.Replace("ws", "http"), UriKind.Absolute);
|
||||
} else {
|
||||
baseUri = new Uri(ApiUri.Replace("wss", "https"), UriKind.Absolute);
|
||||
}
|
||||
var relativeUri = new Uri("cache/" + hash, UriKind.Relative);
|
||||
var fileUri = new Uri(baseUri, relativeUri);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user