diff --git a/src/NuGetGallery/Controllers/ApiController.cs b/src/NuGetGallery/Controllers/ApiController.cs index 0c1ef7b6ea..18ef5b4075 100644 --- a/src/NuGetGallery/Controllers/ApiController.cs +++ b/src/NuGetGallery/Controllers/ApiController.cs @@ -266,7 +266,7 @@ public async virtual Task VerifyPackageKeyAsync(string id, string private async Task VerifyPackageKeyInternalAsync(User user, Credential credential, string id, string version) { // Verify that the user has permission to push for the specific Id \ version combination. - var package = PackageService.FindPackageByIdAndVersionStrict(id, version); + var package = PackageService.FindPackageByIdAndVersion(id, version, semVerLevelKey: SemVerLevelKey.SemVer2); if (package == null) { return new HttpStatusCodeWithBodyResult( diff --git a/tests/NuGetGallery.Facts/Controllers/ApiControllerFacts.cs b/tests/NuGetGallery.Facts/Controllers/ApiControllerFacts.cs index 3c04a23f3c..0d51dad36e 100644 --- a/tests/NuGetGallery.Facts/Controllers/ApiControllerFacts.cs +++ b/tests/NuGetGallery.Facts/Controllers/ApiControllerFacts.cs @@ -1052,7 +1052,9 @@ internal TestableApiController SetupController(string keyType, string scopes, Pa var id = package?.PackageRegistration?.Id ?? "foo"; var version = package?.Version ?? "1.0.0"; - controller.MockPackageService.Setup(s => s.FindPackageByIdAndVersionStrict(id, version)).Returns(package); + controller.MockPackageService + .Setup(s => s.FindPackageByIdAndVersion(id, version, SemVerLevelKey.SemVer2, true)) + .Returns(package); controller.SetCurrentUser(user, scopes);