From 97af9d0bd2d26948ac64b7ef159e4560f814525e Mon Sep 17 00:00:00 2001 From: Menci Date: Tue, 9 Apr 2019 10:58:41 +0800 Subject: [PATCH] Add no_cdn option --- app.js | 2 +- config-example.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 1a55405..4c1740f 100644 --- a/app.js +++ b/app.js @@ -217,7 +217,7 @@ global.syzoj = { app.use(Session(sessionConfig)); app.use((req, res, next) => { - res.locals.useLocalLibs = !!parseInt(req.headers['syzoj-no-cdn']); + res.locals.useLocalLibs = !!parseInt(req.headers['syzoj-no-cdn']) || syzoj.config.no_cdn; let User = syzoj.model('user'); if (req.session.user_id) { diff --git a/config-example.json b/config-example.json index f54885a..2c5a90b 100644 --- a/config-example.json +++ b/config-example.json @@ -120,5 +120,6 @@ "google_fonts": { "type": "like-google-fonts", "url": "https://fonts.loli.net" - } + }, + "no_cdn": false }