aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-11-24 13:10:46 -0600
committerJP Dillingham <jp@dillingham.me>2026-11-24 13:10:46 -0600
commit428bb614675c1a6b5fcecf5e0ccdafded7b30cde (patch)
tree2596b87dfa5353b2c770fd4a75fda9278a92c5a0 /src/slskd
parent5861fd95d40023504bb8105ecf986093fda68f76 (diff)
downloadslskd-428bb614675c1a6b5fcecf5e0ccdafded7b30cde.tar.gz
better guidance about wildcard
Diffstat (limited to 'src/slskd')
-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 != "*"))