aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/slskd/Core/Options.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index 69723b33..88301098 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -2415,9 +2415,17 @@ namespace slskd
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
- if (AllowedOrigins?.Count(x => x == "*") > 1)
+ if (AllowedOrigins?.Contains("*") ?? false)
{
- yield return new ValidationResult("Specify only one wildcard origin (\"*\")");
+ if (AllowedOrigins.Count(x => x == "*") > 1)
+ {
+ yield return new ValidationResult("Specify only one wildcard origin (\"*\")");
+ }
+
+ if (AllowedOrigins.Any(x => x != "*"))
+ {
+ yield return new ValidationResult("Specifying wildcard origin (\"*\") with other origins has no effect; remove either the wildcard or all non-wildcard origins");
+ }
}
foreach (var origin in (AllowedOrigins ?? []).Where(o => o != "*"))