nephila / giturlparse

Parse & rewrite git urls (supports GitHub, Bitbucket, Assembla ...)
https://pypi.python.org/pypi/giturlparse
Apache License 2.0
31 stars 21 forks source link

Github URL's with hypen in owner name are not parsed properly #14

Closed ksdme closed 5 years ago

ksdme commented 5 years ago
>>> 
>>> url_hyphen = 'https://github.com/foo-bar/xpwn'
>>> url = 'https://github.com/foobar/xpwn'
>>> 
>>> giturlparse.parse(url_hyphen)
Parsed(pathname='/foo-bar', protocols=['https'], protocol='https', href='https://github.com/foo-bar/xpwn', resource='github.com', user=None, port=None, name='foo-bar', owner=None)
>>> 
>>> giturlparse.parse(url)
Parsed(pathname='/foobar/xpwn', protocols=['https'], protocol='https', href='https://github.com/foobar/xpwn', resource='github.com', user=None, port=None, name='xpwn', owner='foobar')
>>> 
yakky commented 5 years ago

@ksdme I cannot reproduce this in version 0.9.1+ following the reported commands

Could you provide more information regarding pyhton version and maybe a runnable PoC

I will add this case to the testsuite, but I can't reproduce failure there

ksdme commented 5 years ago

@yakky Sorry, I confused this repo with https://github.com/retr0h/git-url-parse. I have tested your library and it works fine. Please feel free to close this issue.

yakky commented 5 years ago

@ksdme thanks for the feedback, closing this