Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No public url call when public registry is disabled #5948

Merged
merged 4 commits into from
Oct 21, 2022

Conversation

honeyankit
Copy link
Contributor

@honeyankit honeyankit commented Oct 21, 2022

Context

When pubic registry is disabled in the Nuget, it still tries to make a call to public registry url (https://api.nuget.org/v3-flatcontainer/nuget.versioning/6.2.1/nuget.versioning.nuspec) to get the nuspec file if no nuspec file url is provided.

Solution

Earlier, in the dependency_nuspec_url function of the metadata finder, a default public nuspec url was added if the source was missing or if the source was present but had no nuspec file. I have removed the injection of the default public nuspec url when there is either no source or no nuspec url specified in the source.

Even without my change from this PR, when nuspec url was nil in source, the metadata finder was calling the default nuspec url and returning 404.

Note

Nuspec file: A .nuspec file is an XML manifest that contains package metadata. This manifest is used both to build the package and to provide information to consumers. The manifest is always included in a package. [ref]

@honeyankit honeyankit requested a review from a team as a code owner October 21, 2022 16:45
Copy link
Member

@jakecoffman jakecoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, if the URL is empty we shouldn't automatically fall back to the public registry.

@honeyankit honeyankit force-pushed the honeyankit/nuget-fix-public-registy-call branch from 3872696 to 76cf547 Compare October 21, 2022 20:20
@honeyankit honeyankit merged commit 5db2b11 into main Oct 21, 2022
@honeyankit honeyankit deleted the honeyankit/nuget-fix-public-registy-call branch October 21, 2022 20:48
@pavera pavera mentioned this pull request Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants