ImportHandler: Lint the response script sent to the browser

This commit is contained in:
Richard Hansen 2021-02-07 19:36:29 -05:00 committed by John McLear
parent 0ff131bbbb
commit ed80883709

View file

@ -272,6 +272,13 @@ exports.doImport = (req, res, padId) => {
status = err.status;
}).then(() => {
// close the connection
res.send(`<script>document.addEventListener('DOMContentLoaded', function(){ var impexp = window.parent.padimpexp.handleFrameCall('${req.directDatabaseAccess}', '${status}'); })</script>`);
res.send([
'<script>',
"document.addEventListener('DOMContentLoaded', () => {",
' window.parent.padimpexp.handleFrameCall(',
` '${req.directDatabaseAccess}', '${status}');`,
'});',
'</script>',
].join('\n'));
});
};