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:
parent
d9213200c6
commit
7e3ba184f7
2 changed files with 7 additions and 6 deletions
|
@ -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.
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue