do not rely on "*" being present in configuration when picking file shard
This commit is contained in:
@@ -101,7 +101,8 @@ public class ServerFilesController : ControllerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
var shard = selectedShards
|
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();
|
.ThenBy(g => Guid.NewGuid()).FirstOrDefault();
|
||||||
|
|
||||||
baseUrl = shard?.CdnFullUrl ?? _configuration.GetValue<Uri>(nameof(StaticFilesServerConfiguration.CdnFullUrl));
|
baseUrl = shard?.CdnFullUrl ?? _configuration.GetValue<Uri>(nameof(StaticFilesServerConfiguration.CdnFullUrl));
|
||||||
|
|||||||
Reference in New Issue
Block a user