We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f793d3 commit 72be24cCopy full SHA for 72be24c
lib/pyld/jsonld.py
@@ -589,7 +589,12 @@ def parse_url(url):
589
# regex from RFC 3986
590
p = r'^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?'
591
m = re.match(p, url)
592
- return ParsedUrl(*m.groups())
+ # remove default http and https ports
593
+ g = list(m.groups())
594
+ if ((g[0] == 'https' and g[1].endswith(':443')) or
595
+ (g[0] == 'http' and g[1].endswith(':80'))):
596
+ g[1] = g[1][:g[1].rfind(':')]
597
+ return ParsedUrl(*g)
598
599
600
def unparse_url(parsed):
0 commit comments