Merge pull request #8818 from EvanHahn/helmet-xssFilter-improvements

Improve Helmet's xssFilter options
This commit is contained in:
Masahiro Wakame
2016-04-06 01:16:35 +09:00
2 changed files with 9 additions and 3 deletions
+2
View File
@@ -17,6 +17,8 @@ function helmetTest() {
*/
function xssFilterTest() {
app.use(helmet.xssFilter());
app.use(helmet.xssFilter({}));
app.use(helmet.xssFilter({ setOnOldIE: false }));
app.use(helmet.xssFilter({ setOnOldIE: true }));
}
+7 -3
View File
@@ -24,7 +24,11 @@ declare module "helmet" {
disableAndroid? : boolean;
directives? : IHelmetCspDirectives
}
interface IHelmetXssFilterConfiguration {
setOnOldIE? : boolean;
}
/**
* @summary Interface for helmet class.
* @interface
@@ -82,11 +86,11 @@ declare module "helmet" {
publicKeyPins(options ?: Object):express.RequestHandler;
/**
* @summary Prevent Cross-site scripting attacks.
* @summary Mitigate cross-site scripting attacks with the "X-XSS-Protection" header.
* @return {RequestHandler} The Request handler.
* @param {Object} options The options.
*/
xssFilter(options ?: Object):express.RequestHandler;
xssFilter(options ?: IHelmetXssFilterConfiguration):express.RequestHandler;
/**
* @summary Set policy around third-party content via headers