From 810c6dbd45f5e842dbf6e1b74b734fa07306a8ed Mon Sep 17 00:00:00 2001 From: rootdarkarchon Date: Sat, 13 Jan 2024 11:20:21 +0100 Subject: [PATCH] do not rely on "*" being present in configuration when picking file shard --- .../Controllers/ServerFilesController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs b/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs index 97620f7..3534fb3 100644 --- a/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs +++ b/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs @@ -101,7 +101,8 @@ public class ServerFilesController : ControllerBase } var shard = selectedShards - .OrderBy(s => s.Continents.Contains("*", StringComparer.Ordinal) ? 0 : 1) + .OrderBy(s => !s.Continents.Any() ? 0 : 1) + .ThenBy(s => s.Continents.Contains("*", StringComparer.Ordinal) ? 0 : 1) .ThenBy(g => Guid.NewGuid()).FirstOrDefault(); baseUrl = shard?.CdnFullUrl ?? _configuration.GetValue(nameof(StaticFilesServerConfiguration.CdnFullUrl));