|
|
|
@ -170,6 +170,9 @@ module.exports = function (app, middleware, hotswapIds, callback) {
|
|
|
|
|
res.redirect(relativePath + '/assets/uploads' + req.path + '?' + meta.config['cache-buster']);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// only warn once
|
|
|
|
|
var warned = new Set();
|
|
|
|
|
|
|
|
|
|
// DEPRECATED
|
|
|
|
|
var deprecatedPaths = [
|
|
|
|
|
'/nodebb.min.js',
|
|
|
|
@ -188,8 +191,11 @@ module.exports = function (app, middleware, hotswapIds, callback) {
|
|
|
|
|
];
|
|
|
|
|
app.use(relativePath, function (req, res, next) {
|
|
|
|
|
if (deprecatedPaths.some(function (path) { return req.path.startsWith(path); })) {
|
|
|
|
|
winston.verbose('[deprecated] Accessing `' + req.path.slice(1) + '` from `/` is deprecated. ' +
|
|
|
|
|
if (!warned.has(req.path)) {
|
|
|
|
|
winston.warn('[deprecated] Accessing `' + req.path.slice(1) + '` from `/` is deprecated to be REMOVED in NodeBB v1.7.0. ' +
|
|
|
|
|
'Use `/assets' + req.path + '` to access this file.');
|
|
|
|
|
warned.add(req.path);
|
|
|
|
|
}
|
|
|
|
|
res.redirect(relativePath + '/assets' + req.path + '?' + meta.config['cache-buster']);
|
|
|
|
|
} else {
|
|
|
|
|
next();
|
|
|
|
@ -197,8 +203,11 @@ module.exports = function (app, middleware, hotswapIds, callback) {
|
|
|
|
|
});
|
|
|
|
|
// DEPRECATED
|
|
|
|
|
app.use(relativePath + '/api/language', function (req, res) {
|
|
|
|
|
winston.verbose('[deprecated] Accessing language files from `/api/language` is deprecated. ' +
|
|
|
|
|
if (!warned.has(req.path)) {
|
|
|
|
|
winston.warn('[deprecated] Accessing language files from `/api/language` is deprecated to be REMOVED in NodeBB v1.7.0. ' +
|
|
|
|
|
'Use `/assets/language' + req.path + '.json` for prefetch paths.');
|
|
|
|
|
warned.add(req.path);
|
|
|
|
|
}
|
|
|
|
|
res.redirect(relativePath + '/assets/language' + req.path + '.json?' + meta.config['cache-buster']);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|