How do I not set an HTTP header with Superagent, and how do I then test that the header is not set with Supertest? Do I set it to an empty string, or undefined, or null, or what? For example, in this jQuery function, how would I not set the header in the else block:
if(this.true == true) {
request
.post('/page')
.set('X-XSS-Protection', '1; mode=block');
else {
request
.post('/page')
.set('X-XSS-Protection', /*what do I put here?*/);
And, with Buster.js in this case, how do I test it?
request = require('supertest');
express = require('express');
server = express();
request(server)
.get('/page')
.expect(/*what do I put here?*/);
well, i suppose you just shouldn't set it then :) just leave it out!
It's just a matter of testing, whether the header is set or not!