forked from solderpunk/AV-98
monkey patching
This commit is contained in:
parent
b745b04f7a
commit
4fd8b89f49
|
@ -41,6 +41,13 @@ CRLF = '\r\n'
|
||||||
DEFAULT_TIMEOUT = 10
|
DEFAULT_TIMEOUT = 10
|
||||||
_MAX_REDIRECTS = 5
|
_MAX_REDIRECTS = 5
|
||||||
|
|
||||||
|
# monkey-patch Gemini support in urllib.parse
|
||||||
|
# see https://github.com/python/cpython/blob/master/Lib/urllib/parse.py
|
||||||
|
urllib.parse.uses_relative.append("gemini")
|
||||||
|
urllib.parse.uses_netloc.append("gemini")
|
||||||
|
urllib.parse.uses_relative.append("spartan")
|
||||||
|
urllib.parse.uses_netloc.append("spartan")
|
||||||
|
|
||||||
def parse_mime(mime):
|
def parse_mime(mime):
|
||||||
options = {}
|
options = {}
|
||||||
if mime:
|
if mime:
|
||||||
|
|
|
@ -131,13 +131,6 @@ _ABBREVS = {
|
||||||
_MIME_HANDLERS = {
|
_MIME_HANDLERS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
# monkey-patch Gemini support in urllib.parse
|
|
||||||
# see https://github.com/python/cpython/blob/master/Lib/urllib/parse.py
|
|
||||||
urllib.parse.uses_relative.append("gemini")
|
|
||||||
urllib.parse.uses_netloc.append("gemini")
|
|
||||||
urllib.parse.uses_relative.append("spartan")
|
|
||||||
urllib.parse.uses_netloc.append("spartan")
|
|
||||||
|
|
||||||
#An IPV6 URL should be put between []
|
#An IPV6 URL should be put between []
|
||||||
#We try to detect them has location with more than 2 ":"
|
#We try to detect them has location with more than 2 ":"
|
||||||
def fix_ipv6_url(url):
|
def fix_ipv6_url(url):
|
||||||
|
|
Loading…
Reference in New Issue