ImportHandler: Lint the response script sent to the browser

pull/4779/head
Richard Hansen 2021-02-07 19:36:29 -05:00 committed by John McLear
parent 0ff131bbbb
commit ed80883709
1 changed files with 8 additions and 1 deletions

View File

@ -272,6 +272,13 @@ exports.doImport = (req, res, padId) => {
status = err.status; status = err.status;
}).then(() => { }).then(() => {
// close the connection // 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'));
}); });
}; };