diff --git a/src/client/app/widgets/plots/image.js b/src/client/app/widgets/plots/image.js index 57997036..5cd61125 100644 --- a/src/client/app/widgets/plots/image.js +++ b/src/client/app/widgets/plots/image.js @@ -57,7 +57,7 @@ module.exports = class Image extends StaticProperties(Widget, {bypass: true}) { if (!s.length) { - this.value = this.getProp('value') + this.value = this.getProp('default') } else if (s != 'reload') { diff --git a/src/server/server.js b/src/server/server.js index 56223fb1..ad9bfa87 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -1,5 +1,6 @@ var urlparser = require('url'), path = require('path'), + fs = require('fs'), send = require('send'), http = require('http'), server = http.createServer(httpRoute), @@ -16,7 +17,9 @@ var urlparser = require('url'), function httpRoute(req, res) { res.sendFile = (path)=>{ - send(req, path.split('?')[0]).pipe(res) + var fpath = path.split('?')[0] + if (!fs.existsSync(fpath)) throw `File "${fpath}" not found.` + send(req, fpath).pipe(res) } var url = req.url