Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#554 config option to disable welcome page #555

Merged
merged 1 commit into from
Jun 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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