1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-13 06:32:34 +01:00
send/server/initScript.js

18 lines
410 B
JavaScript
Raw Normal View History

2018-08-08 00:40:17 +02:00
const html = require('choo/html');
const raw = require('choo/html/raw');
module.exports = function(state) {
// return '';
return state.cspNonce
? html`
2018-11-16 21:39:36 +01:00
<script nonce="${state.cspNonce}">
const downloadMetadata = ${
state.downloadMetadata
? raw(JSON.stringify(state.downloadMetadata))
: '{}'
};
</script>
`
2018-08-08 00:40:17 +02:00
: '';
};