@node-red/registry 4.1.9 → 4.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/installer.js +5 -5
  2. package/package.json +2 -2
package/lib/installer.js CHANGED
@@ -147,8 +147,7 @@ async function installModule(module,version,url) {
147
147
  var isExisting = false;
148
148
  if (url) {
149
149
  if (pkgurlRe.test(url) || localtgzRe.test(url)) {
150
- // Git remote url or Tarball url - check the valid package url
151
- installName = localtgzRe.test(url) && slashRe.test(url) ? `"${url}"` : url;
150
+ installName = url;
152
151
  isRegistryPackage = false;
153
152
  } else {
154
153
  log.warn(log._("server.install.install-failed-url",{name:module,url:url}));
@@ -504,12 +503,13 @@ async function getTarballModuleInfo(tarball) {
504
503
 
505
504
  function uninstallModule(module) {
506
505
  // This function is called when the admin api is called to remove a module.
507
- // A check in node.js#removeModule verifies the module being removed is already in the registry
506
+ // A check in nodes.js#removeModule verifies the module being removed is already in the registry
508
507
  // as a user module. As such, we can have confidence that the `module` passed here is
509
- // a valid and recognised module name.
508
+ // a valid and recognised module name. But lets not rely 100% on that.
510
509
  activePromise = activePromise.then(() => {
511
510
  return new Promise((resolve,reject) => {
512
- if (/[.\s;]/.test(module)) {
511
+ // Ensure its a valid package name and nothing has slipped through other checks
512
+ if (!validateNpmPackageName(module).validForOldPackages) {
513
513
  reject(new Error(log._("server.install.invalid")));
514
514
  return;
515
515
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/registry",
3
- "version": "4.1.9",
3
+ "version": "4.1.10",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./lib/index.js",
6
6
  "repository": {
@@ -16,7 +16,7 @@
16
16
  }
17
17
  ],
18
18
  "dependencies": {
19
- "@node-red/util": "4.1.9",
19
+ "@node-red/util": "4.1.10",
20
20
  "clone": "2.1.2",
21
21
  "fs-extra": "11.3.0",
22
22
  "npm": "^10.9.8",