frame: allow loading local html/css/js files, add sandbox restrictions (#560)

This commit is contained in:
bordun 2019-09-11 10:34:20 +02:00
parent 9198ba99f0
commit 65bb430512
3 changed files with 7 additions and 2 deletions

View file

@ -48,7 +48,7 @@ function httpRoute(req, res) {
url = url.replace('_:_', ':') // escaped drive colon
url = url.replace(/^\/([^/]*:)/, '$1') // strip leading slash
if (url.match(/.(jpg|jpeg|png|apng|gif|webp|tiff|xbm|bmp|ico|ttf|otf|woff|woff2)(\?[0-9]*)?$/i)) {
if (url.match(/.(jpg|jpeg|png|apng|gif|webp|tiff|xbm|bmp|ico|ttf|otf|woff|woff2|html|css|js)(\?[0-9]*)?$/i)) {
try {
// relative resolution (session path)
var id = urlparser.parse('?' + req.headers.cookie, true).query.client_id,