mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add referrerPolicy to helmet type definition (#16134)
Add an optional extended description…
This commit is contained in:
parent
2c5a92b5e2
commit
54017f4f76
@ -190,6 +190,13 @@ function noSniffTest() {
|
||||
app.use(helmet.noSniff());
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for {@see helmet#referrerPolicy} function.
|
||||
*/
|
||||
function referrerPolicyTest() {
|
||||
app.use(helmet.referrerPolicy({ policy: 'same-origin' }))
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for {@see helmet#xssFilter} function.
|
||||
*/
|
||||
|
||||
10
types/helmet/index.d.ts
vendored
10
types/helmet/index.d.ts
vendored
@ -88,6 +88,10 @@ declare namespace helmet {
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
export interface IHelmetReferrerPolicyConfiguration {
|
||||
policy?: string;
|
||||
}
|
||||
|
||||
export interface IHelmetXssFilterConfiguration {
|
||||
setOnOldIE?: boolean;
|
||||
}
|
||||
@ -163,6 +167,12 @@ declare namespace helmet {
|
||||
*/
|
||||
noSniff(): express.RequestHandler;
|
||||
|
||||
/**
|
||||
* @summary Adds the "Referrer-Policy" header.
|
||||
* @return {RequestHandler} The Request handler.
|
||||
*/
|
||||
referrerPolicy(options?: IHelmetReferrerPolicyConfiguration): express.RequestHandler;
|
||||
|
||||
/**
|
||||
* @summary Mitigate cross-site scripting attacks with the "X-XSS-Protection" header.
|
||||
* @param {IHelmetXssFilterConfiguration} options The options
|
||||
|
||||
Loading…
Reference in New Issue
Block a user