escape and quote the robotsTxt when templating

for now, we restrict the string length to 4096 since that is what
nginx allows
This commit is contained in:
Girish Ramakrishnan
2017-07-23 18:55:31 -07:00
parent 4fec2fe124
commit eb99f8b844
4 changed files with 10 additions and 7 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ function configureAdmin(certFilePath, keyFilePath, configFileName, vhost, callba
certFilePath: certFilePath,
keyFilePath: keyFilePath,
xFrameOptions: 'SAMEORIGIN',
robotsTxt: 'User-agent: *\\nDisallow: /\\n'
robotsTxtQuoted: JSON.stringify('User-agent: *\nDisallow: /\n')
};
var nginxConf = ejs.render(NGINX_APPCONFIG_EJS, data);
var nginxConfigFilename = path.join(paths.NGINX_APPCONFIG_DIR, configFileName);
@@ -64,7 +64,7 @@ function configureApp(app, certFilePath, keyFilePath, callback) {
endpoint: endpoint,
certFilePath: certFilePath,
keyFilePath: keyFilePath,
robotsTxt: app.robotsTxt,
robotsTxtQuoted: app.robotsTxt ? JSON.stringify(app.robotsTxt) : null,
xFrameOptions: app.xFrameOptions || 'SAMEORIGIN' // once all apps have been updated/
};
var nginxConf = ejs.render(NGINX_APPCONFIG_EJS, data);