Skip to content

[Feature] Respect default http/https port #6796

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

Open
2 tasks done
TheAsda opened this issue May 14, 2025 · 0 comments
Open
2 tasks done

[Feature] Respect default http/https port #6796

TheAsda opened this issue May 14, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@TheAsda
Copy link

TheAsda commented May 14, 2025

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

I'm using a private Artifactory repository. In the setup guide, they provide the command: npm config set registry https://repository.company.com/artifactory/api/npm/v-npm/. However, when requesting package information, the response contains something like "tarball": "https://repository.company.com:443/artifactory/api/npm/v-npm/package-name/-/package-name-version.tgz". The current implementation of isConventionalTarballUrl treats a difference in port as a sign of an unconventional tarball. Thus the __archiveUrl is added to every package in yarn.lock when it's unnecessary.

Describe the solution you'd like

The solution would be to ignore the default ports, e.g., 80 for HTTP and 443 for HTTPS, if they are present. This would prevent the issue without affecting unconventional URLs.

Describe the drawbacks of your solution

Using default and custom repositories won't be affected. This change will only provide convenience for different URL variants, such as https://repository.com and https://repostiory.com:443, which basically mean the same. The unnecessary __archiveUrl won't appear.

Describe alternatives you've considered

Currently, the only way to prevent this is to determine if the JSON returned from the repository contains a port. Depending on this, configure the npmRegistryServer accordingly to prevent the __archiveUrl from appearing.

@TheAsda TheAsda added the enhancement New feature or request label May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant