DO NOT remove the : character when sanitizing paths. That breaks NPM for packages

This commit is contained in:
ekatek
2014-06-16 21:03:07 -07:00
parent 6226860b58
commit bb77100672
2 changed files with 2 additions and 2 deletions

View File

@@ -102,7 +102,7 @@ _.extend(Builder.prototype, {
// Basic sanitization
if (part.match(/^\.+$/))
throw new Error("Path contains forbidden segment '" + part + "'");
part = part.replace(/[^a-zA-Z0-9._-]/g, '');
part = part.replace(/[^a-zA-Z0-9._\:-]/g, '');
// If at last component, pull extension (if any) off of part
var ext = '';

View File

@@ -15,7 +15,7 @@ var release = require('./release.js');
// XXX: This is a medium-term hack, to avoid having the user set a package name
// & test-name in package.describe. We will change this in the new control file
// world in some way.
var AUTO_TEST_POSTFIX = "-localtest";
var AUTO_TEST_POSTFIX = ":test";
var isTestName = function (name) {
var nameEnd = name.substr(name.length - AUTO_TEST_POSTFIX.length);
return nameEnd === AUTO_TEST_POSTFIX;