Add referrerPolicy to helmet type definition (#16134)

Add an optional extended description…
This commit is contained in:
Nicholas Simmons 2017-04-27 12:52:24 -04:00 committed by Sheetal Nandi
parent 2c5a92b5e2
commit 54017f4f76
2 changed files with 17 additions and 0 deletions

View File

@ -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.
*/

View File

@ -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