<?php
/**
* This file is created by Really Simple Security to test the CSP header length
* It will not load during regular wordpress execution
*/


if ( !headers_sent() ) {
if ( !function_exists("rsssl_is_ssl" ) ) {
  function rsssl_is_ssl() {
    if (    ( isset($_SERVER["HTTPS"]) && ("on" === $_SERVER["HTTPS"] || "1" === $_SERVER["HTTPS"]) )
    || (isset($_ENV["HTTPS"]) && ("on" === $_ENV["HTTPS"]))
    || (isset($_SERVER["SERVER_PORT"]) && ( "443" === $_SERVER["SERVER_PORT"] ) )
    || (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "1") !== false))
    || (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "on") !== false))
    || (isset($_SERVER["HTTP_CF_VISITOR"]) && (strpos($_SERVER["HTTP_CF_VISITOR"], "https") !== false))
    || (isset($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"], "https") !== false))
    || (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_X_FORWARDED_PROTO"], "https") !== false))
    || (isset($_SERVER["HTTP_X_PROTO"]) && (strpos($_SERVER["HTTP_X_PROTO"], "SSL") !== false))
    ) {
      return true;
    }
    return false;
  }
}
if ( rsssl_is_ssl() ) header("Strict-Transport-Security: max-age=63072000;preload");
header("X-XSS-Protection: 0");
header("Referrer-Policy: strict-origin-when-cross-origin");
header("X-Frame-Options: SAMEORIGIN");

if (function_exists('header_remove')) {
    header_remove('X-Powered-By');
} else {
    header('X-Powered-By: ');
}

header("Content-Security-Policy: frame-ancestors 'self' ; upgrade-insecure-requests;");

}
header("X-REALLY-SIMPLE-SSL-TEST: -%25xV%1Dt%00%B8%7D%1A%BB%3C%9Cyv-ma%82%0E%97%A4%11%03%A9%1E%B8%3D%E4%9E%DB%EC0%DB%A8%E0%C3%8FBm%8E%94H%AD%1F%06%AE%BBtD%3F%D2%F6%3E%40%9B%ACaU1%1F%60v%DB%AC%A5%A3%8C%3Cq%05%16%16%D1%A5%87%B9%F0UB%3C%09X%05%B8UN%5E%5C%B3%86%F9%C1y%5E%1A%26%3Ax%82%3F%5D%89.+%E3%92%CCv%18%E9%A9%89%18%0D%D0%23OK%9C%F7D%1A2%E4%CF%F0%FE%F7%AC%C2%D2%EE_l%94ZM%09%16%DC%E3%ED%8F%AE%1A%07%15%E9%16N%B6%AB%0C%A6f1%10%AF%89%7B%23%FB%3B%0F%89%D7%06%24%D9+%BAw%B4ri%C7%E0C%D0%3C%2A%D2%AB%82wx%F7%07%ECC%A3%DD%F5P%E5%04%14%BC%81");

 echo '<html><head><meta charset="UTF-8"><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head><body>Really Simple Security headers test page</body></html>';