theme: send empty response to fail silently if no theme string
This commit is contained in:
parent
0a722b5368
commit
471f96db3a
1 changed files with 7 additions and 3 deletions
|
|
@ -13,9 +13,13 @@ express.get('/', function(req, res){
|
|||
res.sendFile(path.resolve(__dirname + '/../browser/index.html'))
|
||||
})
|
||||
express.get('*', function(req, res){
|
||||
if (req.path.indexOf('theme.css') != -1 && settings.read('theme')) {
|
||||
res.set('Content-Type', 'text/css');
|
||||
res.send(new Buffer(settings.read('theme')))
|
||||
if (req.path.indexOf('theme.css') != -1) {
|
||||
if (settings.read('theme')) {
|
||||
res.set('Content-Type', 'text/css');
|
||||
res.send(new Buffer(settings.read('theme')))
|
||||
} else {
|
||||
res.send('')
|
||||
}
|
||||
} else {
|
||||
res.sendFile(path.resolve(__dirname + '/../browser' + req.path))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue