diff --git a/index.js b/index.js index ea0ad29a..4a1bc1b2 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,6 @@ -var app = require('express')(); +var pkg = require('./package'), + app = require('express')(); /** ----------------------- middleware ----------------------- **/ @@ -10,7 +11,8 @@ app.use(function(req, res, next){ res.header('Access-Control-Allow-Methods', 'GET'); res.header('Access-Control-Allow-Headers', 'X-Requested-With,content-type'); res.header('Access-Control-Allow-Credentials', true); - res.header('X-Powered-By', 'pelias'); + res.header('Server', 'Pelias/'+pkg.version); + res.header('X-Powered-By', 'mapzen'); next(); }); diff --git a/test/ciao/index.coffee b/test/ciao/index.coffee index 2a9dba88..76797848 100644 --- a/test/ciao/index.coffee +++ b/test/ciao/index.coffee @@ -14,8 +14,12 @@ response.should.have.header 'Charset','utf8' #? cache-control header correctly set response.should.have.header 'Cache-Control','public,max-age=60' +#? server header correctly set +response.should.have.header 'Server' +response.headers.server.should.match /Pelias\/\d{1,2}\.\d{1,2}\.\d{1,2}/ + #? vanity header correctly set -response.should.have.header 'X-Powered-By','pelias' +response.should.have.header 'X-Powered-By','mapzen' #? should respond in json with server info should.exist json