Skip to content

Commit

Permalink
Adds new "match" filter type to stats dashboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanedwardes committed Feb 19, 2024
1 parent 7ba4d20 commit a9a26bc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion misc/Ae.Dns.Console/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,15 @@ string CreateQueryStringWithout(string name)
if (context.Request.Query.ContainsKey("host"))
{
query = query.Where(x => x.Query.Host.EndsWith(context.Request.Query["host"]));
switch (context.Request.Query.TryGetValue("hostFilterType", out var rawFilterType) ? rawFilterType.ToString() : "suffix")
{
case "match":
query = query.Where(x => x.Query.Host.Contains(context.Request.Query["host"], StringComparison.InvariantCultureIgnoreCase));
break;
case "suffix":
query = query.Where(x => x.Query.Host.EndsWith(context.Request.Query["host"], StringComparison.InvariantCultureIgnoreCase));
break;
}
}
var filteredQueries = query.ToArray();
Expand Down

0 comments on commit a9a26bc

Please sign in to comment.