1 parent
2fcb29e3fe
commit
97a5098511
23 files changed
+146
-57
No files matched your search
@@ -95,6 +95,7 @@ CONTENT_TYPES = {
|
||||
".jpg": "image/jpeg",
|
||||
".jpeg": "image/jpeg",
|
||||
".ico": "image/x-icon",
|
||||
".webmanifest": "application/manifest+json; charset=utf-8",
|
||||
}
|
||||
|
||||
|
||||
@@ -547,6 +548,14 @@ class Handler(BaseHTTPRequestHandler):
|
||||
def _static(self, path):
|
||||
if path in ("/", ""):
|
||||
path = "/index.html"
|
||||
if path == "/sw.js":
|
||||
full = os.path.join(STATIC, "sw.js")
|
||||
if os.path.isfile(full):
|
||||
with open(full, "rb") as fh:
|
||||
self._send(200, fh.read(), "application/javascript; charset=utf-8")
|
||||
else:
|
||||
self._error(404, "not found")
|
||||
return
|
||||
rel = path.lstrip("/")
|
||||
if rel.startswith("static/"):
|
||||
rel = rel[len("static/"):]
|
||||
|
||||
Reference in new issue
Block a user