Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Wrong NuGet API response code for package with no versions available
-
Microsoft's NuGet server API documentation for enumerating package versions says the API response should be 404 when the package source has no versions of the requested package:
https://learn.microsoft.com/en-us/nuget/api/package-base-address-resource#enumerate-package-versionsBut ProGet currently returns 200 with an empty array:
{ "versions": [] }
The documentation doesn't say the 404 should have specific body content, but just for comparison, api.nuget.org returns an XML body:
<?xml version="1.0" encoding="utf-8"?> <Error> <Code>BlobNotFound</Code> <Message>The specified blob does not exist. RequestId:d5844934-501e-000f-5804-f3cb9b000000 Time:2023-09-29T18:43:32.7072199Z</Message> </Error>
The reason this is an issue for me is because I use the Version Lens extension for VS Code, which currently relies on the documented 404 behavior:
https://marketplace.visualstudio.com/items?itemName=pflannery.vscode-versionlens
-
Hi @ssuenaga_1020 ,
Thanks for the detailed report; this seems easy enough to fix, so we'll get this addressed in the next maintenance release (2023.20) via PG-2499.
Cheers,
Alana