From 84fa7972e3bed3ebd824394c8ef2a6674e37f963 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Tue, 30 Aug 2016 21:20:42 -0700 Subject: [PATCH] Skip minification for userscript --- package.json | 2 +- src/web/webserver.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5bf34594..705aad79 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.21.0", + "version": "3.21.1", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/src/web/webserver.js b/src/web/webserver.js index 8093fa2e..5aac81ed 100644 --- a/src/web/webserver.js +++ b/src/web/webserver.js @@ -162,6 +162,13 @@ module.exports = { if (!fs.existsSync(cacheDir)) { fs.mkdirSync(cacheDir); } + app.use((req, res, next) => { + if (/\.user\.js/.test(req.url)) { + res._no_minify = true; + } + + next(); + }); app.use(require('express-minify')({ cache: cacheDir }));