mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Merge pull request #8818 from EvanHahn/helmet-xssFilter-improvements
Improve Helmet's xssFilter options
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