fix: Serve CORS header for fonts

This commit is contained in:
Tom Moor
2023-09-15 21:10:03 -04:00
parent 266a2f4485
commit 8c2a47db9d

View File

@@ -32,6 +32,9 @@ router.use(["/images/*", "/email/*", "/fonts/*"], async (ctx, next) => {
root: path.resolve(__dirname, "../../../public"),
// 7 day expiry, these assets are mostly static but do not contain a hash
maxAge: 7 * 24 * 60 * 60 * 1000,
setHeaders: (res) => {
res.setHeader("Access-Control-Allow-Origin", "*");
},
});
} catch (err) {
if (err.status !== 404) {