diff options
author | John McLear <john@mclear.co.uk> | 2012-11-01 13:32:04 +0000 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2012-11-01 13:32:04 +0000 |
commit | 5629063b9cc80e23a725050c754bc06812333958 (patch) | |
tree | 617201fd265baa367b06b97301dc32022a85bdf1 /src/node | |
parent | 0cbacf5b4bd3133ea062ecff87c504fc366c47e7 (diff) | |
download | etherpad-lite-5629063b9cc80e23a725050c754bc06812333958.zip |
Allow robots.txt to be custom
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/hooks/express/specialpages.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/node/hooks/express/specialpages.js b/src/node/hooks/express/specialpages.js index a5834492..50d27700 100644 --- a/src/node/hooks/express/specialpages.js +++ b/src/node/hooks/express/specialpages.js @@ -12,8 +12,16 @@ exports.expressCreateServer = function (hook_name, args, cb) { //serve robots.txt args.app.get('/robots.txt', function(req, res) { - var filePath = path.normalize(__dirname + "/../../../static/robots.txt"); - res.sendfile(filePath); + var filePath = path.normalize(__dirname + "/../../../static/custom/robots.txt"); + res.sendfile(filePath, function(err) + { + //there is no custom favicon, send the default robots.txt which dissallows all + if(err) + { + filePath = path.normalize(__dirname + "/../../../static/robots.txt"); + res.sendfile(filePath); + } + }); }); //serve favicon.ico |