forked from oclif/plugin-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: only return false on 404 in hasNpmPackage (#96)
Currently, if the registry returns anything that is not a 200 status code this function returns `false`. In the case where we are trying to check whether the package associated to a friendly name and the registry returns for example a 503 this will result in fetching and installing the wrong package. i.e. Doing `heroku plugins:install api` - Attempt to see if [`@heroku-cli/plugin-api`](https://www.npmjs.com/package/@heroku-cli/plugin-api) exists - NPM returns 503 - Install [`api`](https://www.npmjs.com/package/api)!! In this case this is fairly harmless as that particularly library doesn't do much, however, it is annoying and could be used maliciously!
- Loading branch information
Showing
4 changed files
with
193 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.