diff --git a/CoAuthoring/sources/DocsCoServer.js b/CoAuthoring/sources/DocsCoServer.js index 40728758..2260e16d 100644 --- a/CoAuthoring/sources/DocsCoServer.js +++ b/CoAuthoring/sources/DocsCoServer.js @@ -1934,3 +1934,24 @@ exports.commandFromServer = function (req, res) { } }); }; +exports.getDefaultLicense = function (req, res) { + logger.debug('Start getDefaultLicense request'); + + var options = { + root: config.get('server.default_license_file_path'), + dotfiles: 'deny', + headers: { + 'x-timestamp': Date.now(), + 'x-sent': true + } + }; + res.sendFile(config.get('server.default_license_file_name'), options, function(err) { + if (err) { + logger.error(err); + res.status(err.status).end(); + } else { + logger.debug('Sent success: license.lic)'); + } + }); + logger.debug('Start getDefaultLicense request'); +}; \ No newline at end of file diff --git a/CoAuthoring/sources/server.js b/CoAuthoring/sources/server.js index f975aaf5..e7083a1b 100644 --- a/CoAuthoring/sources/server.js +++ b/CoAuthoring/sources/server.js @@ -87,6 +87,8 @@ if (cluster.isMaster) { app.get('/' + fontsRoute + 'odttf/:fontname', fontService.getFont); } + app.get('/license', docsCoServer.getDefaultLicense); + app.get('/ConvertService.ashx', converterService.convert); app.post('/ConvertService.ashx', converterService.convert); diff --git a/Common/config/default.json b/Common/config/default.json index b2135dbb..18e2de02 100644 --- a/Common/config/default.json +++ b/Common/config/default.json @@ -63,7 +63,9 @@ "editor_settings_readerformats": "doct;docx;doc;odt;rtf;txt;mht;html;htm;epub;mobi;fb2", "editor_settings_editorformats": "doct;xlst;pptt;docx;doc;odt;xlsx;xls;ods;csv;pptx;ppt;ppsx;pps;odp;rtf;txt;mht;html;htm;epub;mobi;fb2", "editor_settings_viewerformats": "pdf;xps;djvu;tiff", - "license_file_path": "" + "license_file_path": "", + "default_license_file_path": "./../../", + "default_license_file_name": "./license2.lic" }, "utils": { "utils_common_fontdir": "null",