mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Improve Helmet's xssFilter options
Made two improvements here: 1. `xssFilter` takes an object with a certain interface, not just any `Object`. 2. Changed the `@summary` documentation.
This commit is contained in:
@@ -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 }));
|
||||
}
|
||||
|
||||
|
||||
Vendored
+7
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user