mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 16:47:22 +01:00
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:
parent
801969f0d2
commit
143c0b1e81
1 changed files with 6 additions and 1 deletions
|
|
@ -55,7 +55,12 @@ namespace MareSynchronos.WebAPI
|
||||||
wc.DownloadProgressChanged += progChanged;
|
wc.DownloadProgressChanged += progChanged;
|
||||||
|
|
||||||
string fileName = Path.GetTempFileName();
|
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 relativeUri = new Uri("cache/" + hash, UriKind.Relative);
|
||||||
var fileUri = new Uri(baseUri, relativeUri);
|
var fileUri = new Uri(baseUri, relativeUri);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue