Skip to content

Commit 90d11f7

Browse files
alericksonCopilot
andauthored
Bug fix for filtering on version
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 06e8a86 commit 90d11f7

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/code/NuGetServerAPICalls.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ public override Task<FindResults> FindVersionAsync(string packageName, string ve
6363
});
6464
var filterBuilder = queryBuilder.FilterBuilder;
6565

66-
// We need to explicitly add 'Id eq <packageName>' whenever $filter is used, otherwise arbitrary results are returned.
67-
filterBuilder.AddCriterion($"Id eq '{packageName}'");
68-
filterBuilder.AddCriterion($"NormalizedVersion eq '{packageName}'");
69-
66+
// We need to explicitly add 'Id eq <packageName>' whenever $filter is used, otherwise arbitrary results are returned.
67+
filterBuilder.AddCriterion($"Id eq '{packageName}'");
68+
filterBuilder.AddCriterion($"NormalizedVersion eq '{version}'");
7069
var requestUrl = $"{Repository.Uri}/FindPackagesById()?{queryBuilder.BuildQueryString()}";
7170
string response = HttpRequestCallAsync(requestUrl, debugMsgs, out ErrorRecord errRecord);
7271
FindResults findResponse = new FindResults(stringResponse: new string[] { response }, hashtableResponse: emptyHashResponses, responseType: FindResponseType);

0 commit comments

Comments
 (0)