Impressum/Datenschutz für Abrufdienste freigeben
- web/robots.txt als echte Datei: vorher landete /robots.txt im Front Controller und antwortete mit 303 auf /login. Jetzt: Allow für /impressum und /datenschutz, Disallow für den Rest.\n- X-Robots-Tag noindex/nofollow/noarchive nur noch für die App, nicht mehr für die beiden Pflichtseiten.\n- Kein Session-Cookie mehr auf den Rechtsseiten (Header wurden vor dem Session-Start gesetzt).
This commit is contained in:
parent
cf1849a9ce
commit
87ccd36d0a
3 changed files with 15 additions and 4 deletions
|
|
@ -23,11 +23,14 @@ function is_https(): bool
|
|||
return strtolower((string) ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '')) === 'https';
|
||||
}
|
||||
|
||||
function security_headers(): void
|
||||
function security_headers(bool $indexable = false): void
|
||||
{
|
||||
header('X-Content-Type-Options: nosniff');
|
||||
header('X-Frame-Options: DENY');
|
||||
header('X-Robots-Tag: noindex, nofollow, noarchive');
|
||||
// Impressum/Datenschutz bleiben abrufbar; alles andere ist eine private App.
|
||||
if (!$indexable) {
|
||||
header('X-Robots-Tag: noindex, nofollow, noarchive');
|
||||
}
|
||||
header('Referrer-Policy: same-origin');
|
||||
header('Permissions-Policy: camera=(), microphone=(), geolocation=()');
|
||||
header(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue