Update ApIController.Functions.Files.cs
Only replace the first occurrence of "ws" in the Uri string
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Linq;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using LZ4;
|
using LZ4;
|
||||||
@@ -55,7 +56,7 @@ namespace MareSynchronos.WebAPI
|
|||||||
wc.DownloadProgressChanged += progChanged;
|
wc.DownloadProgressChanged += progChanged;
|
||||||
|
|
||||||
string fileName = Path.GetTempFileName();
|
string fileName = Path.GetTempFileName();
|
||||||
var baseUri = new Uri(ApiUri.Replace("ws", "http"), UriKind.Absolute);
|
var baseUri = new Uri(Regex.Replace(ApiUri, "^ws", "http"), 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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user