Re-added referrer policy since mw implementation does not include response header

This commit is contained in:
alistair3149 2020-01-09 19:26:16 -05:00
parent 36f0c07fa5
commit def3f44ed0
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C
2 changed files with 17 additions and 0 deletions

View file

@ -177,6 +177,17 @@ class SkinCitizen extends SkinTemplate {
}
}
/**
* Adds the referrer header if enabled in 'CitizenEnableStrictReferrerPolicy'
*/
private function addStrictReferrerPolicy() {
if ( $this->getConfigValue( 'CitizenEnableStrictReferrerPolicy' ) === true ) {
// iOS Safari, IE, Edge compatiblity
$this->out->getRequest()->response()->header( 'Referrer-Policy: strict-origin' );
$this->out->getRequest()->response()->header( 'Referrer-Policy: strict-origin-when-cross-origin' );
}
}
/**
* Adds the Feature policy header to the response if enabled in 'CitizenFeaturePolicyDirective'
*/

View file

@ -87,6 +87,12 @@
"descriptionmsg": "citizen-config-enablexxssprotection",
"public": true
},
"EnableStrictReferrerPolicy": {
"value": false,
"description": "Enable or disable strict-origin-when-cross-origin referrer policy",
"descriptionmsg": "citizen-config-enablestrictreferrerpolicy",
"public": true
},
"EnableFeaturePolicy": {
"value": false,
"description": "Enable or disable Feature Policy",