forked from solderpunk/AV-98
fixes hang/crash when meeting ; itemtype in gopher
This commit is contained in:
parent
29c447cd8e
commit
bf17b21b30
|
@ -17,6 +17,7 @@ Changes since beta1
|
||||||
- fixes a bug in HTML renderer where some hX element were not closed properly
|
- fixes a bug in HTML renderer where some hX element were not closed properly
|
||||||
- fixes input in Gemini while online
|
- fixes input in Gemini while online
|
||||||
- fixes a crash with invalid URL
|
- fixes a crash with invalid URL
|
||||||
|
- fixes hang/crash when meeting the ";" itemtype in gopher
|
||||||
- attempt at hiding XMLparsedAsHTMLWarning from BS4 library
|
- attempt at hiding XMLparsedAsHTMLWarning from BS4 library
|
||||||
- chafa now used by default everywhere if version > 1.10
|
- chafa now used by default everywhere if version > 1.10
|
||||||
- ignoring encoding error in ansicat
|
- ignoring encoding error in ansicat
|
||||||
|
|
|
@ -1247,7 +1247,7 @@ def get_mime(path,url=None):
|
||||||
mime = "text/gopher"
|
mime = "text/gopher"
|
||||||
elif itemtype == "h":
|
elif itemtype == "h":
|
||||||
mime = "text/html"
|
mime = "text/html"
|
||||||
elif itemtype in ("9","g","I","s"):
|
elif itemtype in ("9","g","I","s",";"):
|
||||||
mime = "binary"
|
mime = "binary"
|
||||||
else:
|
else:
|
||||||
mime = "text/gopher"
|
mime = "text/gopher"
|
||||||
|
|
|
@ -371,7 +371,7 @@ def _fetch_gopher(url,timeout=DEFAULT_TIMEOUT,**kwargs):
|
||||||
response = s.makefile("rb").read()
|
response = s.makefile("rb").read()
|
||||||
# Transcode response into UTF-8
|
# Transcode response into UTF-8
|
||||||
#if itemtype in ("0","1","h"):
|
#if itemtype in ("0","1","h"):
|
||||||
if not itemtype in ("9","g","I","s"):
|
if not itemtype in ("9","g","I","s",";"):
|
||||||
# Try most common encodings
|
# Try most common encodings
|
||||||
for encoding in ("UTF-8", "ISO-8859-1"):
|
for encoding in ("UTF-8", "ISO-8859-1"):
|
||||||
try:
|
try:
|
||||||
|
@ -392,7 +392,7 @@ def _fetch_gopher(url,timeout=DEFAULT_TIMEOUT,**kwargs):
|
||||||
mime = "text/gopher"
|
mime = "text/gopher"
|
||||||
elif itemtype == "h":
|
elif itemtype == "h":
|
||||||
mime = "text/html"
|
mime = "text/html"
|
||||||
elif itemtype in ("9","g","I","s"):
|
elif itemtype in ("9","g","I","s",";"):
|
||||||
mime = None
|
mime = None
|
||||||
else:
|
else:
|
||||||
# by default, we should consider Gopher
|
# by default, we should consider Gopher
|
||||||
|
|
Loading…
Reference in New Issue
Block a user