<?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");

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: %5B%02%7F%AA%047%12%15%AA%92M%87%28%D0%8B%F1%FF%C9ak%0EQB%1Ef%88%D5z9%3A%E0%2A%2F%1C%1C%E0%0B%B2%F8%C8ntg%AD%82%3D%E8K%D6%2C%9C%84%F6%D3%DAXQ%15%3E%96k%E5s%17%ABV%AE%D3%01%86%1D%24%ECi%3A%03K%D6%C6k%D9%B0K%40p%8B%91%9CI%1A%3B%C5%E7%C1%A8%9B%C0%0D6%F2%F2%3C2%DFV%29%ADb%C6%EFG%1E7%BA%B1%120Y%F8%0B%CE%ABT%937%5D%00%1FZY%E6u%13%09%EC%9C%C7%BF%FC%CF%1E%0F%DA%10%25%92%1F%DFeL%B8y%80%B7%09%BB%D7%B1%B5%C2w%D3%87%BB%09%AE%D2%FB%5E%2F%C9F%2A%E1%CA%A5%12%A5%88%EB%2B%3E%C1%2C%86%89%17%84%3C%5E%DE%28E%86o%83");

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