<?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; includeSubDomains;preload');
header('X-XSS-Protection: 0');
header('X-Content-Type-Options: nosniff');
header('Referrer-Policy: strict-origin-when-cross-origin');
header('X-Frame-Options: SAMEORIGIN');
header('Cross-Origin-Opener-Policy: same-origin');
header('Cross-Origin-Resource-Policy: same-origin');
header('Cross-Origin-Embedder-Policy: same-origin');

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: %CB%AA%10H+%83%D9%3BW%A8%21%13%D7%1B%9DG%21%E7%3Da%B0%8Cq%10%F0m%8F%DA%CB%04%10%3A-%E8%7CC%E2%C3%05%40%C8%D59%11%7B%1B%F0zW%A5%8EH%9F%D8%A2%BE%1A%2F%A4%A1%CAp%3D+%C2%DA%FD%A3d%B5%9B%A7%DD%05U%23u%0C%B6%00%16%C3%60%9A8R%A4%A9Q%E0%98%A7.%D4%3B%8A%CE%21%81%B1h%7D%8D%7D%2F%D99C%DD%A6XQ%E6%DB%A1%5C%BD%7C%8D%27%93%FB%03%19%B5%FDo%7Eds%99%18%FB%BD%1D%B7%D9%E2%C9%1EFJ%FBl%87%3D%B51%89%13.%8A%D7%14%0C%2CWQl%D7%C5%14%3FNC%DFb%FD%84%15%BFh%12by%21%F4%21f%B1%FA%8C%25j%1B%19j%E9%A0Z%ED%87h3O%8BG%BA%EE%5C%5D%');

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