Merge branch 'master' of github.com:Fastinyoh/NodeBB into Fastinyoh-master

v1.18.x
Julian Lam 11 years ago
commit b44cbc89ad

@ -15,7 +15,7 @@ var _ = require('underscore'),
module.exports = function(app, middleware, controllers) { module.exports = function(app, middleware, controllers) {
// Static Assets // Static Assets
app.get('/plugins/:id/*', function(req, res) { app.get('/plugins/:id/*', function(req, res) {
var relPath = req._parsedUrl.pathname.replace(nconf.get('relative_path') + '/plugins/', ''), var relPath = req._parsedUrl.pathname.replace('/plugins/', ''),
matches = _.map(plugins.staticDirs, function(realPath, mappedPath) { matches = _.map(plugins.staticDirs, function(realPath, mappedPath) {
if (relPath.match(mappedPath)) { if (relPath.match(mappedPath)) {
return mappedPath; return mappedPath;
@ -44,11 +44,11 @@ module.exports = function(app, middleware, controllers) {
if (matches.length) { if (matches.length) {
res.sendfile(matches[0]); res.sendfile(matches[0]);
} else { } else {
res.redirect('/404'); res.redirect(nconf.get('relative_path') + '/404');
} }
}); });
} else { } else {
res.redirect('/404'); res.redirect(nconf.get('relative_path') + '/404');
} }
}); });
}; };

Loading…
Cancel
Save