From d2fb9abf80b078c5eeca3e9f663f9a1258397cc0 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 10 Oct 2021 21:38:28 -0400 Subject: [PATCH] EnsureStatusCode and a comment note --- Dalamud/Plugin/Internal/PluginRepository.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dalamud/Plugin/Internal/PluginRepository.cs b/Dalamud/Plugin/Internal/PluginRepository.cs index 90b7918db..cf579dce6 100644 --- a/Dalamud/Plugin/Internal/PluginRepository.cs +++ b/Dalamud/Plugin/Internal/PluginRepository.cs @@ -75,9 +75,12 @@ namespace Dalamud.Plugin.Internal { Log.Information($"Fetching repo: {this.PluginMasterUrl}"); using var client = new HttpClient(); - using var response = await client.GetAsync(this.PluginMasterUrl + "?" + DateTime.Now.Ticks); - var data = await response.Content.ReadAsStringAsync(); + // ?ticks causes a cache invalidation. Get a fresh repo every time. + using var response = await client.GetAsync(this.PluginMasterUrl + "?" + DateTime.Now.Ticks); + response.EnsureSuccessStatusCode(); + + var data = await response.Content.ReadAsStringAsync(); var pluginMaster = JsonConvert.DeserializeObject>(data); if (pluginMaster == null)