Skip to content

Commit

Permalink
Merge pull request #83 from linkRace/master
Browse files Browse the repository at this point in the history
No sniff test
  • Loading branch information
grawk committed May 2, 2016
2 parents d0078fd + 32e81ba commit 33f1dea
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/nosniff.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*global describe:false, it:false */
'use strict';


var lusca = require('../index'),
request = require('supertest'),
assert = require('assert'),
mock = require('./mocks/app');



describe('nosniff', function () {

it('method', function () {
assert(typeof lusca.nosniff === 'function');
});

it('header (enabled)', function (done) {
var config = { nosniff: true },
app = mock(config);

app.get('/', function (req, res) {
res.status(200).end();
});

request(app)
.get('/')
.expect('X-Content-Type-Options', 'no sniff')
.expect(200, done);
});
});

0 comments on commit 33f1dea

Please sign in to comment.