diff --git a/RZ.Server/RZ.Plugin.Software.Proxy/RZ.Plugin.Software.Proxy.cs b/RZ.Server/RZ.Plugin.Software.Proxy/RZ.Plugin.Software.Proxy.cs index 8d4aedd..bea7cb2 100644 --- a/RZ.Server/RZ.Plugin.Software.Proxy/RZ.Plugin.Software.Proxy.cs +++ b/RZ.Server/RZ.Plugin.Software.Proxy/RZ.Plugin.Software.Proxy.cs @@ -277,15 +277,18 @@ private void UpdateURLs(ref JArray jSource) foreach (JObject oFiles in jObj["Files"]) { - if (FileNames.Contains(oFiles["FileName"].Value().ToLower())) + if (oFiles["URL"] != null && oFiles["URL"].ToString().ToLower().StartsWith("http")) { - //oFiles["URL"] = Base.localURL + "/rest/v2/GetFile/" + sContentID + "/" + oFiles["FileName"].ToString().Replace("\\", "/"); - oFiles["URL"] = Base.localURL + "/rest/v2/GetFile/" + sContentID + "/" + oFiles["FileName"].ToString().Replace("\\", "/"); - - } - else - { - oFiles["URL"] = Base.localURL + "/rest/v2/GetFile/proxy/" + jObj["ShortName"].ToString() + "/" + sContentID + "/" + oFiles["FileName"].ToString().Replace("\\", "/"); + if (FileNames.Contains(oFiles["FileName"].Value().ToLower())) + { + //oFiles["URL"] = Base.localURL + "/rest/v2/GetFile/" + sContentID + "/" + oFiles["FileName"].ToString().Replace("\\", "/"); + oFiles["URL"] = Base.localURL + "/rest/v2/GetFile/" + sContentID + "/" + oFiles["FileName"].ToString().Replace("\\", "/"); + + } + else + { + oFiles["URL"] = Base.localURL + "/rest/v2/GetFile/proxy/" + jObj["ShortName"].ToString() + "/" + sContentID + "/" + oFiles["FileName"].ToString().Replace("\\", "/"); + } } } } @@ -333,6 +336,7 @@ public async Task GetFile(string FilePath) try { + _cache = new MemoryCache(new MemoryCacheOptions()); //clear cache... using (HttpClient oClient = new HttpClient()) { using (var response = await oClient.GetAsync(URL, HttpCompletionOption.ResponseHeadersRead)) @@ -369,8 +373,6 @@ public async Task GetFile(string FilePath) } } } - - } return null; diff --git a/RZ.Server/RZ.Plugin.Software.Proxy/RZ.Plugin.Software.Proxy.csproj b/RZ.Server/RZ.Plugin.Software.Proxy/RZ.Plugin.Software.Proxy.csproj index e444ce5..a5f5ebb 100644 --- a/RZ.Server/RZ.Plugin.Software.Proxy/RZ.Plugin.Software.Proxy.csproj +++ b/RZ.Server/RZ.Plugin.Software.Proxy/RZ.Plugin.Software.Proxy.csproj @@ -8,7 +8,7 @@ - + all runtime; build; native; contentfiles; analyzers