Skip to content

Instantly share code, notes, and snippets.

@thedude42
Created June 11, 2015 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedude42/791df26fff3827412318 to your computer and use it in GitHub Desktop.
Save thedude42/791df26fff3827412318 to your computer and use it in GitHub Desktop.
Insert some OWASP useful headers in LineRate Precision
"use strict";
var vsm = require("lrs/virtualServerModule"),
virtualServerName = "myVirtualServer";
vsm.on("exist", virtualServerName, function(vs) {
vs.on("request", insertUsefulHeaders);
});
function insertUsefulHeaders(servReq, servResp, cliReq) {
cliReq.on("response", function(cliResp) {
cliResp.bindHeaders(servResp);
servResp.setHeader("X-Frame-Options", "deny");
servResp.setHeader("X-XSS-Protection", "1; mode=block");
servResp.setHeader("X-Content-Type-Options: nosniff");
cliResp.fastPipe(servResp);
});
servReq.bindHeaders(cliReq);
servReq.fastPipe(cliReq);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment