hosted-git-info
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="3.0.3"></a> | ||
## [3.0.3](https://github.com/npm/hosted-git-info/compare/v3.0.2...v3.0.3) (2020-02-25) | ||
<a name="3.0.2"></a> | ||
@@ -7,0 +12,0 @@ ## [3.0.2](https://github.com/npm/hosted-git-info/compare/v3.0.1...v3.0.2) (2019-10-08) |
12
index.js
@@ -50,3 +50,3 @@ 'use strict' | ||
if (parsed.auth && authProtocols[parsed.protocol]) { | ||
auth = decodeURIComponent(parsed.auth) | ||
auth = parsed.auth | ||
} | ||
@@ -110,3 +110,11 @@ var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null | ||
var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) | ||
if (!matched) return url.parse(giturl) | ||
if (!matched) { | ||
var legacy = url.parse(giturl) | ||
if (legacy.auth) { | ||
var whatwg = new url.URL(giturl) | ||
legacy.auth = whatwg.username || '' | ||
if (whatwg.password) legacy.auth += ':' + whatwg.password | ||
} | ||
return legacy | ||
} | ||
return { | ||
@@ -113,0 +121,0 @@ protocol: 'git+ssh:', |
{ | ||
"name": "hosted-git-info", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24274
336