Skip to content

Commit

Permalink
uses regex
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoTUI committed Nov 27, 2017
1 parent 6a6d0d5 commit 82f63c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/js/main.js
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion bin/app.js
Expand Up @@ -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);
Expand Down

0 comments on commit 82f63c6

Please sign in to comment.