mirror of https://gitlab.com/bashrc2/epicyon
support dat
parent
11d7192edb
commit
3837ee2536
|
@ -833,11 +833,11 @@ def load_document(url):
|
||||||
# validate URL
|
# validate URL
|
||||||
pieces = urllib_parse.urlparse(url)
|
pieces = urllib_parse.urlparse(url)
|
||||||
if (not all([pieces.scheme, pieces.netloc]) or
|
if (not all([pieces.scheme, pieces.netloc]) or
|
||||||
pieces.scheme not in ['http', 'https'] or
|
pieces.scheme not in ['http', 'https', 'dat'] or
|
||||||
set(pieces.netloc) > set(
|
set(pieces.netloc) > set(
|
||||||
string.ascii_letters + string.digits + '-.:')):
|
string.ascii_letters + string.digits + '-.:')):
|
||||||
raise JsonLdError(
|
raise JsonLdError(
|
||||||
'URL could not be dereferenced; only "http" and "https" '
|
'URL could not be dereferenced; only http/https/dat '
|
||||||
'URLs are supported.',
|
'URLs are supported.',
|
||||||
'jsonld.InvalidUrl', {'url': url},
|
'jsonld.InvalidUrl', {'url': url},
|
||||||
code='loading document failed')
|
code='loading document failed')
|
||||||
|
|
Loading…
Reference in New Issue