Skip to content

Commit a8056fa

Browse files
committed
bonescript: add image/svg+xml and remove eval
* Removed one eval and replaced it with a call to func.apply * Added handling for files of type image/svg+xml (.svg)
1 parent da98346 commit a8056fa

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

bonescript/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,6 @@ if(socketio.exists) {
616616
}
617617
}
618618
callargs.push(callback);
619-
var toeval = name + '(' + callargs + ');';
620-
//console.log('Calling ' + toeval);
621619
myfuncs[name].func.apply(this, callargs);
622620
} catch(ex) {
623621
console.log('Error handing ' + name + ' message: ' + ex);
@@ -659,10 +657,10 @@ exports.Server = function(port, subdir, onconnect) {
659657
loadFile(uri, subdir, res, "text/css");
660658
} else if(uri.match(/\.htm(.)$/i)) {
661659
loadFile(uri, subdir, res, "text/html");
660+
} else if(uri.match(/\.svg$/i)) {
661+
loadFile(uri, subdir, res, "image/svg+xml");
662662
} else if(uri.match(/\.(jpg|png|ico)$/i)) {
663663
loadFile(uri, subdir, res, "binary");
664-
} else if(uri.match(/\.svg(.)$/i)) {
665-
loadFile(uri, subdir, res, "image/svg+xml");
666664
} else {
667665
loadFile(uri, subdir, res, "text/plain");
668666
}

0 commit comments

Comments
 (0)