Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid host for Bitbucket / Gitlab #10

Closed
pomek opened this issue Jan 12, 2017 · 2 comments
Closed

Invalid host for Bitbucket / Gitlab #10

pomek opened this issue Jan 12, 2017 · 2 comments

Comments

@pomek
Copy link

pomek commented Jan 12, 2017

Hi,

For the code below, parseGithubUrl returns an invalid host:

const parseGithubUrl = require( 'parse-github-url' );
const repositoryInfo = parseGithubUrl( '[email protected]:assemble/verb.git#v1.2.3' );
console.log( repositoryInfo );
Url {
	protocol: null,
	slashes: null,
	auth: null,
	host: 'github.com',
	port: null,
	hostname: null,
	hash: '#v1.2.3',
	search: null,
	query: null,
	pathname: '[email protected]:assemble/verb.git',
	path: '[email protected]:assemble/verb.git',
	href: '[email protected]:assemble/verb.git#v1.2.3',
	filepath: null,
	owner: 'assemble',
	name: 'verb',
	repo: 'assemble/verb',
	branch: 'v1.2.3',
	repository: 'assemble/verb' 
}
@tunnckoCore
Copy link

tunnckoCore commented Jan 12, 2017

i believe it's because the obj.repo || 'github.com' line (search for it), prs welcome. :)

@doowb
Copy link
Collaborator

doowb commented Jan 12, 2017

It looks like if you don't provide a protocol (e.g. http://, https://, or git:// the url library doesn't return a host property so this library defaults to github.com for the host.

Also, you have a : between the host and the path, shouldn't that be a /?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants