From b86ce01aa2032e2ecda3b879b1626b9f2d476106 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 28 Jan 2018 11:52:19 +0000 Subject: [PATCH] Test missing HSTS header --- tests/server.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/server.test.ts b/tests/server.test.ts index f20c083..3911d25 100644 --- a/tests/server.test.ts +++ b/tests/server.test.ts @@ -108,5 +108,13 @@ describe('Server', function () { done(); }); }); + + it('Should not have HSTS header if HTTP is allowed', function (done) { + runServer({...SERVER_SETTINGS, allowHttp: true}, '/index.html', function (response : any) { + expect(response.status).to.equal(200); + expect(response.headers.get('strict-transport-security')).to.be.null; + done(); + }); + }); }); });