Skip to content

Commit

Permalink
Merge pull request #555 from joola/feature/#554
Browse files Browse the repository at this point in the history
#554 config option to disable welcome page
  • Loading branch information
itayw committed Jun 15, 2014
2 parents 1b97d52 + 1bdbf6d commit 6904d06
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions config/default.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
version: 0.0.310
version: 0.0.450
interfaces:
webserver:
enabled: true
host: joola.io #used for response-header [Server]
welcome: true
# host: joola.io #used for response-header [Server]
bind: 0.0.0.0
port: 8080
secureport: 8081
Expand All @@ -18,7 +19,7 @@ interfaces:
blacklist: null
alloworigin: null
headers:
X-Powered-By: joola.io
# X-Powered-By: joola.io
repl:
enabled: false
port: 1337
Expand Down
3 changes: 2 additions & 1 deletion lib/webserver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ webserver.start = function (options, callback) {
});

function stampHeaders(req, res, next) {
res.header("Server", joola.config.get('interfaces:webserver:host') || 'N/A');
if (joola.config.get('interfaces:webserver:host'))
res.header("Server", joola.config.get('interfaces:webserver:host'));

var allowOrigin = joola.config.get('interfaces:webserver:alloworigin') || req.headers.origin;
if (allowOrigin)
Expand Down
9 changes: 6 additions & 3 deletions lib/webserver/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ exports.generateerror = function (req, res) {

exports.setup = function (app) {
//main entry point
app.get('/', this.index);
app.get('/playground', this.playground);
app.get('/benchmark', this.benchmark);

if (joola.config.get('interfaces:webserver:welcome') === true) {
app.get('/', this.index);
app.get('/playground', this.playground);
app.get('/benchmark', this.benchmark);
}

app.get('/ip', function (req, res) {
res.setHeader('Content-Type', 'application/javascript');
Expand Down

0 comments on commit 6904d06

Please sign in to comment.