Skip to content

Commit 776f66f

Browse files
author
Igor Hrcek
committed
feat: Removed obsolete security header
1 parent 56e7b1c commit 776f66f

3 files changed

Lines changed: 2 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ wp secure flush
2323
```
2424

2525
### Add Security Headers
26-
Adds the HSTS, Referrer-Policy, X-Content-Type-Options, X-Frame-Options and X-XSS-Protection
26+
Adds the HSTS, Referrer-Policy, X-Content-Type-Options and X-Frame-Options
2727

2828
You can choose to add all above or only one or more by using `--headers` argument.
2929

src/SubCommands/AddSecurityHeaders.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public function getTemplateVars() : array {
1414
'Strict-Transport-Security' => '"max-age=63072000; includeSubDomains; preload"',
1515
'Referrer-Policy' => 'strict-origin-when-cross-origin',
1616
'X-Content-Type-Options' => 'nosniff',
17-
'X-Frame-Options' => 'SAMEORIGIN',
18-
'X-XSS-Protection' => '"1; mode=block"'
17+
'X-Frame-Options' => 'SAMEORIGIN'
1918
];
2019

2120
$headers = $this->commandArguments['headers'] ?? array_keys($default_headers);

tests/Feature/AddSecurityHeadersTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public function testItWillContainAllHeadersOnNginx() : void {
2525
$this->assertNotEmpty($response->getHeaderLine( 'Referrer-Policy' ));
2626
$this->assertNotEmpty($response->getHeaderLine( 'x-content-type-options' ));
2727
$this->assertNotEmpty($response->getHeaderLine( 'X-Frame-Options' ));
28-
$this->assertNotEmpty($response->getHeaderLine( 'X-XSS-Protection' ));
2928
}
3029

3130
public function testItWillContainAllHeadersOnApache() : void {
@@ -35,6 +34,5 @@ public function testItWillContainAllHeadersOnApache() : void {
3534
$this->assertNotEmpty($response->getHeaderLine( 'Referrer-Policy' ));
3635
$this->assertNotEmpty($response->getHeaderLine( 'x-content-type-options' ));
3736
$this->assertNotEmpty($response->getHeaderLine( 'X-Frame-Options' ));
38-
$this->assertNotEmpty($response->getHeaderLine( 'X-XSS-Protection' ));
3937
}
4038
}

0 commit comments

Comments
 (0)