From def75eebf1ad437bf4fd3f5e103cc2d963bd2a73 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Fri, 24 Mar 2017 11:15:09 -0700 Subject: hosted-git-info@2.4.1 * Match git URLs with trailing slashes. * Certain classes of invalid URLs no longer crash. * Preserve case of the user name part of shortcut specifiers, previously they were lowercased. Fixes: https://github.com/npm/hosted-git-info/issues/15 Fixes: https://github.com/npm/hosted-git-info/issues/16 Credit: @iarna --- node_modules/hosted-git-info/git-host-info.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'node_modules/hosted-git-info/git-host-info.js') diff --git a/node_modules/hosted-git-info/git-host-info.js b/node_modules/hosted-git-info/git-host-info.js index cd511e3f7..93cf61744 100644 --- a/node_modules/hosted-git-info/git-host-info.js +++ b/node_modules/hosted-git-info/git-host-info.js @@ -53,7 +53,7 @@ var gitHostDefaults = { 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', 'shortcuttemplate': '{type}:{user}/{project}{#committish}', 'pathtemplate': '{user}/{project}{#committish}', - 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/ + 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/ } Object.keys(gitHosts).forEach(function (name) { @@ -63,6 +63,6 @@ Object.keys(gitHosts).forEach(function (name) { }) gitHosts[name].protocols_re = RegExp('^(' + gitHosts[name].protocols.map(function (protocol) { - return protocol.replace(/([\\+*{}()\[\]$^|])/g, '\\$1') + return protocol.replace(/([\\+*{}()[\]$^|])/g, '\\$1') }).join('|') + '):$') }) -- cgit v1.2.3