8
0

allow webAuthn when server is localhost

Dieser Commit ist enthalten in:
Daniel Seifert 2022-10-28 15:02:28 +02:00
Ursprung 71a1f8e53b
Commit 667c516a00
Signiert von: DanielS
GPG-Schlüssel-ID: 8A7C4C6ED1915C6F

Datei anzeigen

@ -24,11 +24,10 @@ class Webauthn
public function isAvailable()
{
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
return true;
}
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ||
!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on'
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' || // is HTTPS
!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ||
!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on' ||
in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) // is localhost
) {
return true;
}