Skip to content

Commit

Permalink
Fixes logic to filter by upstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanedwardes committed Feb 18, 2024
1 parent 0e0ea97 commit 518c62d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions misc/Ae.Dns.Console/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ string CreateQueryStringWithout(string name)
query = query.Where(x => x.Answer?.Resolver == context.Request.Query["resolver"]);
}

if (context.Request.Query.ContainsKey("upstream"))
if (context.Request.Query.ContainsKey("upstream") && bool.TryParse(context.Request.Query["upstream"], out bool upstream))
{
query = query.Where(x => x.Answer?.Upstream == bool.TryParse(context.Request.Query["upstream"], out bool upstream) && upstream);
query = query.Where(x => x.Answer?.Upstream == upstream);
}

if (context.Request.Query.ContainsKey("server"))
Expand Down

0 comments on commit 518c62d

Please sign in to comment.