remove powered-by header

This commit is contained in:
Jake Howard 2017-05-06 22:59:29 +01:00
parent a54d3528a8
commit 8eb6cc0a7c
2 changed files with 16 additions and 0 deletions

View file

@ -15,6 +15,7 @@ import { Options } from './types';
export default function createServer(opts : Options) : express.Application {
const app = express();
app.disable('x-powered-by');
if (process.env.NODE_ENV !== 'test') {
app.use(logging);
}

View file

@ -20,6 +20,21 @@ describe('Server', function () {
});
});
it('Should nave no x-powered-by header', function (done) {
runServer({
allowed_ips: [],
basicAuth: [],
dirList: false,
serveDir: 'site/',
opbeat: false,
open: false
}, '/index.html', function (response : any) {
expect(response.status).to.equal(200);
expect(response.headers.get('x-powered-by')).to.equal(null);
done();
});
});
describe('index route', function () {
const body = fs.readFileSync(path.join(__dirname, '..', 'site', 'index.html')).toString();