@@ -27,23 +27,23 @@ describe('hsts header missing analyzer', () => {
27
27
} , HSTS_HEADER_MISSING , 1 , function ( vulnerabilities ) {
28
28
expect ( vulnerabilities [ 0 ] . evidence ) . to . be . undefined
29
29
expect ( vulnerabilities [ 0 ] . hash ) . to . be . equals ( analyzer . _createHash ( 'HSTS_HEADER_MISSING:mocha' ) )
30
- } , makeRequestWithXFordwardedProtoHeader )
30
+ } , makeRequestWithXFordwardedProtoHeader , undefined , false )
31
31
32
32
testThatRequestHasVulnerability ( ( req , res ) => {
33
33
res . setHeader ( 'content-type' , 'text/html;charset=utf-8' )
34
34
res . end ( '<html><body><h1>Test</h1></body></html>' )
35
35
} , HSTS_HEADER_MISSING , 1 , function ( vulnerabilities ) {
36
36
expect ( vulnerabilities [ 0 ] . evidence ) . to . be . undefined
37
37
expect ( vulnerabilities [ 0 ] . hash ) . to . be . equals ( analyzer . _createHash ( 'HSTS_HEADER_MISSING:mocha' ) )
38
- } , makeRequestWithXFordwardedProtoHeader )
38
+ } , makeRequestWithXFordwardedProtoHeader , undefined , false )
39
39
40
40
testThatRequestHasVulnerability ( ( req , res ) => {
41
41
res . setHeader ( 'content-type' , 'application/xhtml+xml' )
42
42
res . end ( '<html><body><h1>Test</h1></body></html>' )
43
43
} , HSTS_HEADER_MISSING , 1 , function ( vulnerabilities ) {
44
44
expect ( vulnerabilities [ 0 ] . evidence ) . to . be . undefined
45
45
expect ( vulnerabilities [ 0 ] . hash ) . to . be . equals ( analyzer . _createHash ( 'HSTS_HEADER_MISSING:mocha' ) )
46
- } , makeRequestWithXFordwardedProtoHeader )
46
+ } , makeRequestWithXFordwardedProtoHeader , undefined , false )
47
47
48
48
testThatRequestHasVulnerability ( ( req , res ) => {
49
49
res . setHeader ( 'content-type' , 'text/html' )
@@ -52,7 +52,7 @@ describe('hsts header missing analyzer', () => {
52
52
} , HSTS_HEADER_MISSING , 1 , function ( vulnerabilities ) {
53
53
expect ( vulnerabilities [ 0 ] . evidence . value ) . to . be . equal ( 'max-age=-100' )
54
54
expect ( vulnerabilities [ 0 ] . hash ) . to . be . equals ( analyzer . _createHash ( 'HSTS_HEADER_MISSING:mocha' ) )
55
- } , makeRequestWithXFordwardedProtoHeader )
55
+ } , makeRequestWithXFordwardedProtoHeader , undefined , false )
56
56
57
57
testThatRequestHasVulnerability ( ( req , res ) => {
58
58
res . setHeader ( 'content-type' , 'text/html' )
@@ -61,7 +61,7 @@ describe('hsts header missing analyzer', () => {
61
61
} , HSTS_HEADER_MISSING , 1 , function ( vulnerabilities ) {
62
62
expect ( vulnerabilities [ 0 ] . evidence . value ) . to . be . equal ( 'max-age=-100; includeSubDomains' )
63
63
expect ( vulnerabilities [ 0 ] . hash ) . to . be . equals ( analyzer . _createHash ( 'HSTS_HEADER_MISSING:mocha' ) )
64
- } , makeRequestWithXFordwardedProtoHeader )
64
+ } , makeRequestWithXFordwardedProtoHeader , undefined , false )
65
65
66
66
testThatRequestHasVulnerability ( ( req , res ) => {
67
67
res . setHeader ( 'content-type' , 'text/html' )
@@ -70,7 +70,7 @@ describe('hsts header missing analyzer', () => {
70
70
} , HSTS_HEADER_MISSING , 1 , function ( vulnerabilities ) {
71
71
expect ( vulnerabilities [ 0 ] . evidence . value ) . to . be . equal ( 'invalid' )
72
72
expect ( vulnerabilities [ 0 ] . hash ) . to . be . equals ( analyzer . _createHash ( 'HSTS_HEADER_MISSING:mocha' ) )
73
- } , makeRequestWithXFordwardedProtoHeader )
73
+ } , makeRequestWithXFordwardedProtoHeader , undefined , false )
74
74
75
75
testThatRequestHasVulnerability ( ( req , res ) => {
76
76
res . setHeader ( 'content-type' , [ 'text/html' ] )
@@ -79,7 +79,7 @@ describe('hsts header missing analyzer', () => {
79
79
} , HSTS_HEADER_MISSING , 1 , function ( vulnerabilities ) {
80
80
expect ( vulnerabilities [ 0 ] . evidence . value ) . to . be . equal ( 'invalid' )
81
81
expect ( vulnerabilities [ 0 ] . hash ) . to . be . equals ( analyzer . _createHash ( 'HSTS_HEADER_MISSING:mocha' ) )
82
- } , makeRequestWithXFordwardedProtoHeader )
82
+ } , makeRequestWithXFordwardedProtoHeader , undefined , false )
83
83
84
84
testThatRequestHasVulnerability ( ( req , res ) => {
85
85
res . setHeader ( 'content-type' , [ 'text/html' ] )
@@ -88,7 +88,7 @@ describe('hsts header missing analyzer', () => {
88
88
} , HSTS_HEADER_MISSING , 1 , function ( vulnerabilities ) {
89
89
expect ( vulnerabilities [ 0 ] . evidence ) . to . be . undefined
90
90
expect ( vulnerabilities [ 0 ] . hash ) . to . be . equals ( analyzer . _createHash ( 'HSTS_HEADER_MISSING:mocha' ) )
91
- } , makeRequestWithXFordwardedProtoHeader )
91
+ } , makeRequestWithXFordwardedProtoHeader , undefined , false )
92
92
93
93
testThatRequestHasVulnerability ( ( req , res ) => {
94
94
res . setHeader ( 'content-type' , [ 'text/html' ] )
@@ -97,7 +97,7 @@ describe('hsts header missing analyzer', () => {
97
97
} , HSTS_HEADER_MISSING , 1 , function ( vulnerabilities ) {
98
98
expect ( vulnerabilities [ 0 ] . evidence . value ) . to . be . equal ( JSON . stringify ( [ 'invalid1' , 'invalid2' ] ) )
99
99
expect ( vulnerabilities [ 0 ] . hash ) . to . be . equals ( analyzer . _createHash ( 'HSTS_HEADER_MISSING:mocha' ) )
100
- } , makeRequestWithXFordwardedProtoHeader )
100
+ } , makeRequestWithXFordwardedProtoHeader , undefined , false )
101
101
102
102
testThatRequestHasNoVulnerability ( ( req , res ) => {
103
103
res . setHeader ( 'content-type' , 'application/json' )
0 commit comments