forked from solderpunk/AV-98
consider files as XML, not SVG, if no .svg extension
This commit is contained in:
parent
6ad59020a1
commit
36c9709bc4
|
@ -15,6 +15,7 @@
|
||||||
- opnk: added "--mode" command-line argument (bug #39)
|
- opnk: added "--mode" command-line argument (bug #39)
|
||||||
- offpunk: support for "preformatted" theming (bug #38)
|
- offpunk: support for "preformatted" theming (bug #38)
|
||||||
- opnk/netcache: added "--cache-validity" command-line argument (bug #37)
|
- opnk/netcache: added "--cache-validity" command-line argument (bug #37)
|
||||||
|
- ansicat: consider files as XML, not SVG, if they don’t have .svg extension
|
||||||
|
|
||||||
## 2.1 - December 15th 2023
|
## 2.1 - December 15th 2023
|
||||||
- freshly updated gemtext/rss links are highlighted ("new_link" theme option)
|
- freshly updated gemtext/rss links are highlighted ("new_link" theme option)
|
||||||
|
|
|
@ -1355,6 +1355,9 @@ def get_mime(path,url=None):
|
||||||
# If it’s a xml file, consider it as such, regardless of what file thinks
|
# If it’s a xml file, consider it as such, regardless of what file thinks
|
||||||
elif path.endswith(".xml"):
|
elif path.endswith(".xml"):
|
||||||
mime = "text/xml"
|
mime = "text/xml"
|
||||||
|
# If it doesn’t end with .svg, it is probably an xml, not a SVG file
|
||||||
|
elif "svg" in mime and not path.endswith(".svg"):
|
||||||
|
mime = "text/xml"
|
||||||
#Some xml/html document are considered as octet-stream
|
#Some xml/html document are considered as octet-stream
|
||||||
if mime == "application/octet-stream":
|
if mime == "application/octet-stream":
|
||||||
mime = "text/xml"
|
mime = "text/xml"
|
||||||
|
|
Loading…
Reference in New Issue