From df51e1646909179d77e03f245930f45af4681be4 Mon Sep 17 00:00:00 2001 From: Budleigh Salterton Date: Tue, 13 Oct 2015 13:42:29 +0200 Subject: [PATCH] tests --- test/http-server-test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/http-server-test.js b/test/http-server-test.js index a9240b28..4e6cae0a 100644 --- a/test/http-server-test.js +++ b/test/http-server-test.js @@ -129,7 +129,8 @@ vows.describe('http-server').addBatch({ topic: function () { var server = httpServer.createServer({ root: root, - cors: true + cors: true, + cors_headers: 'X-Test' }); server.listen(8082); this.callback(null, server); @@ -148,6 +149,9 @@ vows.describe('http-server').addBatch({ }, 'status code should be 204': function (err, res) { assert.equal(res.statusCode, 204); + }, + 'response Access-Control-Allow-Headers should contain X-Test': function (err, res, body) { + assert.ok(res.headers['Access-Control-Allow-Headers'].split(/\s*,\s*/g).indexOf('X-Test') >= 0, 204); } } }