Add apple touch icon support for Safari

This commit is contained in:
shortcutme 2019-09-15 22:11:51 +02:00
parent 10817aefae
commit 6f0d4a50d1
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
3 changed files with 4 additions and 3 deletions

View file

@ -119,8 +119,8 @@ class UiRequest(object):
if path == "/": if path == "/":
return self.actionIndex() return self.actionIndex()
elif path == "/favicon.ico": elif path in ("/favicon.ico", "/apple-touch-icon.png"):
return self.actionFile("src/Ui/media/img/favicon.ico") return self.actionFile("src/Ui/media/img/%s" % path)
# Internal functions # Internal functions
elif "/ZeroNet-Internal/" in path: elif "/ZeroNet-Internal/" in path:
path = re.sub(".*?/ZeroNet-Internal/", "/", path) path = re.sub(".*?/ZeroNet-Internal/", "/", path)
@ -350,7 +350,7 @@ class UiRequest(object):
return self.error403("WebSocket request not allowed to load wrapper") # No websocket return self.error403("WebSocket request not allowed to load wrapper") # No websocket
if "text/html" not in self.env.get("HTTP_ACCEPT", ""): if "text/html" not in self.env.get("HTTP_ACCEPT", ""):
return self.error403("Invalid Accept header to load wrapper") return self.error403("Invalid Accept header to load wrapper: %s" % self.env.get("HTTP_ACCEPT", ""))
if "prefetch" in self.env.get("HTTP_X_MOZ", "") or "prefetch" in self.env.get("HTTP_PURPOSE", ""): if "prefetch" in self.env.get("HTTP_X_MOZ", "") or "prefetch" in self.env.get("HTTP_PURPOSE", ""):
return self.error403("Prefetch not allowed to load wrapper") return self.error403("Prefetch not allowed to load wrapper")

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

View file

@ -6,6 +6,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/uimedia/all.css?rev={rev}" /> <link rel="stylesheet" href="/uimedia/all.css?rev={rev}" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
{meta_tags} {meta_tags}
</head> </head>
<body style="{body_style}" class="{themeclass}"> <body style="{body_style}" class="{themeclass}">