generated from jric11/baseProject
Chat's updates for security, db and workflow
Security and workflow regressions / regression (push) Has been cancelled
Security and workflow regressions / regression (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
final class Transport {
|
||||
public static function https(array $server,string $trustedProxies=''): bool {
|
||||
if(in_array(strtolower((string)($server['HTTPS']??'')),['on','1','https'],true))return true;
|
||||
$trusted=array_filter(array_map('trim',explode(',',$trustedProxies)),static fn($ip)=>filter_var($ip,FILTER_VALIDATE_IP)!==false);
|
||||
return in_array($server['REMOTE_ADDR']??'',$trusted,true)&&strtolower(trim($server['HTTP_X_FORWARDED_PROTO']??''))==='https';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user