mirror of https://github.com/sloumdrone/burrow
Fixed issue with URL parsing
This commit is contained in:
parent
9f0f37b8f7
commit
f8d00aa48f
|
@ -16,7 +16,7 @@ class parser:
|
||||||
def parse_url(self, url):
|
def parse_url(self, url):
|
||||||
# Take in a URL and output a dict of the url parts
|
# Take in a URL and output a dict of the url parts
|
||||||
|
|
||||||
regex = r'^(?P<protocol>(?:gopher:\/\/)?)?(?P<host>[\w\.\d]+)(?P<port>(?::\d+)?)?(?P<type>(?:\/[\dgIp])?)?(?P<resource>(?:\/[\w\/\d\-?.]*)?)?$'
|
regex = r'^(?P<protocol>(?:(gopher|http):\/\/)?)?(?P<host>[\w\.\d]+)(?P<port>(?::\d+)?)?(?P<type>(?:\/[\dgIp])?)?(?P<resource>(?:\/\S*)?)?$'
|
||||||
|
|
||||||
match = re.match(regex, url)
|
match = re.match(regex, url)
|
||||||
protocol = match.group('protocol')
|
protocol = match.group('protocol')
|
||||||
|
|
Loading…
Reference in New Issue