bagetter/BaGetter

Do not allow http schema in repository URLs

Opened this issue · 1 comments

Describe the bug

When a package is uploaded, if the repository URL in the package information is http, the URL is not accepted.
Specifically, it is the URL indicated by the repository element of nuspec.

If you upload a package whose repository URL is htttp, the upload itself will succeed.
However, the Source code link that appears on the package page after upload is not the package's configuration, but the URL of the page itself.

I think this is due to the fact that the following code section compares only with Uri.UriSchemeHttps.

if (repositoryUri.Scheme != Uri.UriSchemeHttps)

To Reproduce

  1. The target Bagetter version is v1.4.2.
  2. Create a package whose repository element is http.
  3. Perform a nuget push to Bagetter.
  4. Open the uploaded package page in browser.
    • The Source code link is not appropriate.

Expected behavior

Even if the repository URL is http, it will be properly linked.

I rely on translation tools. I'm sorry if there is a strange sentence.

You're right, since BaGetter is being used internally too, there can be repositories hosted without https still. I don't have time for it right now, but I will review PRs or do it once I have some more time.