Merge pull request #33507 from chdanielmueller/helmet-hsts-option-spelling

[helmet] Fix spelling of a option in hsts and hpkp
This commit is contained in:
Nathan Shively-Sanders
2019-03-07 15:17:36 -08:00
committed by GitHub
3 changed files with 26 additions and 5 deletions
+14 -1
View File
@@ -119,6 +119,13 @@ function hpkpTest() {
sha256s: ['AbCdEf123=', 'ZyXwVu456='],
}));
app.use(helmet.hpkp({
maxAge: 7776000000,
sha256s: ['AbCdEf123=', 'ZyXwVu456='],
includeSubDomains: false
}));
// Deprecated: Use includeSubDomains instead. (Uppercase "D")
app.use(helmet.hpkp({
maxAge: 7776000000,
sha256s: ['AbCdEf123=', 'ZyXwVu456='],
@@ -128,7 +135,7 @@ function hpkpTest() {
app.use(helmet.hpkp({
maxAge: 7776000000,
sha256s: ['AbCdEf123=', 'ZyXwVu456='],
includeSubdomains: true
includeSubDomains: true
}));
app.use(helmet.hpkp({
@@ -162,6 +169,12 @@ function hstsTest() {
maxAge: 7776000000,
}));
app.use(helmet.hsts({
maxAge: 7776000000,
includeSubDomains: true
}));
// Deprecated: Use includeSubDomains instead. (Uppercase "D")
app.use(helmet.hsts({
maxAge: 7776000000,
includeSubdomains: true
+9 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for helmet
// Project: https://github.com/helmetjs/helmet
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Evan Hahn <https://github.com/EvanHahn>, Elliot Blackburn <https://github.com/bluehatbrit>
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Evan Hahn <https://github.com/EvanHahn>, Elliot Blackburn <https://github.com/bluehatbrit>, Daniel Müller <https://github.com/chdanielmueller>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -134,7 +134,11 @@ declare namespace helmet {
export interface IHelmetHpkpConfiguration {
maxAge: number;
sha256s: string[];
/**
* @deprecated Use includeSubDomains instead. (Uppercase "D")
*/
includeSubdomains?: boolean;
includeSubDomains?: boolean;
reportUri?: string;
reportOnly?: boolean;
setIf?: IHelmetSetIfFunction;
@@ -142,7 +146,11 @@ declare namespace helmet {
export interface IHelmetHstsConfiguration {
maxAge?: number;
/**
* @deprecated Use includeSubDomains instead. (Uppercase "D")
*/
includeSubdomains?: boolean;
includeSubDomains?: boolean;
preload?: boolean;
setIf?: IHelmetSetIfFunction;
force?: boolean;
+3 -3
View File
@@ -95,13 +95,13 @@ function hpkpTest() {
app.use(helmet.hpkp({
maxAge: 7776000000,
sha256s: ['AbCdEf123=', 'ZyXwVu456='],
includeSubdomains: false
includeSubDomains: false
}));
app.use(helmet.hpkp({
maxAge: 7776000000,
sha256s: ['AbCdEf123=', 'ZyXwVu456='],
includeSubdomains: true
includeSubDomains: true
}));
app.use(helmet.hpkp({
@@ -137,7 +137,7 @@ function hstsTest() {
app.use(helmet.hsts({
maxAge: 7776000000,
includeSubdomains: true
includeSubDomains: true
}));
app.use(helmet.hsts({