Permalink
Browse files

uses regex

  • Loading branch information...
DiegoTUI committed Nov 27, 2017
1 parent 6a6d0d5 commit 82f63c6c408e6c69666561f5558838731e54803e
Showing with 2 additions and 2 deletions.
  1. +1 −1 app/js/main.js
  2. +1 −1 bin/app.js
View
@@ -14,7 +14,7 @@ app.factory('packages', ['$http', function ($http) {
callback = packageName;
packageName = null;
}
var url = packageName ? '/package/' + packageName.replace('/', '%2F') : '/packages';
var url = packageName ? '/package/' + packageName.replace(/\//g, '%2F') : '/packages';
$http.get(url).success(function (result) {
callback(null, result);
}).error(function (description, status) {
View
@@ -112,7 +112,7 @@ function serve (request, response) {
var mainStream = [];
// look for the package in the registry
mainStream.push(function (callback) {
packages.findInNpmRegistry(npmPackage.replace('/', '%2F'), function (error, result) {
packages.findInNpmRegistry(npmPackage.replace(/\//g, '%2F'), function (error, result) {
if (error) {
log.debug('npm registry error', error);
return callback(error);

0 comments on commit 82f63c6

Please sign in to comment.