summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-10-17 01:49:16 +0200
committerTor Andersson <tor@ccxvii.net>2022-10-17 01:49:42 +0200
commit098d0c123de9251f46a40e228e12b99d92acc9cc (patch)
tree588a85b92dec61edf13be7e31269a453a1e52edf
parentf0a22953342abc6322aa96a24c58dc9702497d8b (diff)
downloadserver-098d0c123de9251f46a40e228e12b99d92acc9cc.tar.gz
Drop AVIF support.
-rw-r--r--public/common/play.js8
-rw-r--r--server.js4
2 files changed, 1 insertions, 11 deletions
diff --git a/public/common/play.js b/public/common/play.js
index ec7cd9b..9e330c0 100644
--- a/public/common/play.js
+++ b/public/common/play.js
@@ -1,13 +1,5 @@
"use strict"
-// TODO: Remove when CSS Images Module Level 4 is widely supported,
-;(function () {
- let avif = new Image()
- avif.src = "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUEAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABkAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgSAAAAAAABNjb2xybmNseAABAA0ABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACFtZGF0EgAKBzgABhAQ0GkyDBZABhhhhAAAeUzRyg=="
- avif.onload = () => document.documentElement.className = "avif"
- avif.onerror = () => document.documentElement.className = "jpeg"
-})()
-
/* URL: /$title_id/(re)play:$game_id:$role */
if (!/\/[\w-]+\/(replay|play|debug):\d+(:[\w-]+)?/.test(window.location.pathname)) {
diff --git a/server.js b/server.js
index df31146..7a1713b 100644
--- a/server.js
+++ b/server.js
@@ -161,10 +161,8 @@ function login_delete(res, sid) {
* Web server setup.
*/
-express.static.mime.define({ "image/avif": ["avif"] })
-
function set_static_headers(res, path) {
- if (path.match(/\.(jpg|png|svg|avif|webp|ico|woff2)$/))
+ if (path.match(/\.(jpg|png|svg|webp|ico|woff2)$/))
res.setHeader("Cache-Control", "max-age=86400")
else
res.setHeader("Cache-Control", "max-age=60")