mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-08 16:42:48 +01:00
Merge branch 'master' of github.com:Fastinyoh/NodeBB into Fastinyoh-master
This commit is contained in:
@@ -15,7 +15,7 @@ var _ = require('underscore'),
|
||||
module.exports = function(app, middleware, controllers) {
|
||||
// Static Assets
|
||||
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) {
|
||||
if (relPath.match(mappedPath)) {
|
||||
return mappedPath;
|
||||
@@ -44,11 +44,11 @@ module.exports = function(app, middleware, controllers) {
|
||||
if (matches.length) {
|
||||
res.sendfile(matches[0]);
|
||||
} else {
|
||||
res.redirect('/404');
|
||||
res.redirect(nconf.get('relative_path') + '/404');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
res.redirect('/404');
|
||||
res.redirect(nconf.get('relative_path') + '/404');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user