send httpUnsafeOrigin via /api/config

pull/1/head
ansuz 7 years ago
parent 044384a576
commit acd5574008

@ -91,6 +91,8 @@ module.exports = {
// cross-domain iframe. It can simply host the same content as CryptPad. // cross-domain iframe. It can simply host the same content as CryptPad.
// httpSafeOrigin: "https://some-other-domain.xyz", // httpSafeOrigin: "https://some-other-domain.xyz",
httpUnsafeOrigin: domain,
/* your server's websocket url is configurable /* your server's websocket url is configurable
* (default: '/cryptpad_websocket') * (default: '/cryptpad_websocket')
* *

@ -150,6 +150,7 @@ app.get('/api/config', function(req, res){
websocketPath: config.useExternalWebsocket ? undefined : config.websocketPath, websocketPath: config.useExternalWebsocket ? undefined : config.websocketPath,
websocketURL:'ws' + ((useSecureWebsockets) ? 's' : '') + '://' + host + ':' + websocketURL:'ws' + ((useSecureWebsockets) ? 's' : '') + '://' + host + ':' +
websocketPort + '/cryptpad_websocket', websocketPort + '/cryptpad_websocket',
httpUnsafeOrigin: config.httpUnsafeOrigin,
}, null, '\t'), }, null, '\t'),
'obj.httpSafeOrigin = ' + (function () { 'obj.httpSafeOrigin = ' + (function () {
if (config.httpSafeOrigin) { return config.httpSafeOrigin; } if (config.httpSafeOrigin) { return config.httpSafeOrigin; }

Loading…
Cancel
Save