1
0
Fork 0
mirror of https://github.com/Alamantus/Lexiconga.git synced 2025-08-08 06:47:34 +02:00

Move content security policy header to Response from htaccess

This commit is contained in:
Robbie Antenesse 2025-07-19 10:01:10 -06:00
parent d9213200c6
commit 7e3ba184f7
2 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,3 @@
# To resolve the issue with "Your connection to this site is not secure" message
Header set Content-Security-Policy: upgrade-insecure-requests env=HTTPS
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^view/([0-9]+)/([0-9]+)/?$ router.php?view=word&dict=$1&word=$2 [NC,L] # Handle word ids.

View file

@ -3,9 +3,13 @@ class Response {
private static function defaultHeaders () {
header('Access-Control-Allow-Origin: *');
header('Expires: Sun, 01 Nov 2015 22:46:51 GMT');
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
if (strpos($_SERVER['SERVER_NAME'], 'localhost') !== false) {
# To resolve the issue with "Your connection to this site is not secure" message
header('Content-Security-Policy: upgrade-insecure-requests env=HTTPS');
}
}
public static function json ($data, $http_code = 200) {