diff options
author | Rebecca Turner <me@re-becca.org> | 2017-03-24 21:15:09 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-03-25 01:13:41 +0300 |
commit | def75eebf1ad437bf4fd3f5e103cc2d963bd2a73 (patch) | |
tree | e0b308d20dfbf0ebf6678eb98a51be531aadf2fe /node_modules/hosted-git-info/git-host-info.js | |
parent | 41789cffac9845603f4bdf3f5b03f412144a0e9f (diff) |
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
Diffstat (limited to 'node_modules/hosted-git-info/git-host-info.js')
-rw-r--r-- | node_modules/hosted-git-info/git-host-info.js | 4 |
1 files changed, 2 insertions, 2 deletions
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('|') + '):$') }) |