1
0
Fork 0
mirror of synced 2024-05-20 20:52:36 +12:00

Fixed protocol getter

This commit is contained in:
Eldad Fux 2020-07-12 19:51:50 +03:00
parent 8d010753c8
commit cc3aa27d57

View file

@ -141,11 +141,13 @@ class Request extends UtopiaRequest
*/
public function getProtocol(): string
{
if($this->getServer('server_protocol', '') === 'HTTP/1.1') {
$protocol = $this->getHeader('x-forwarded-proto', $this->getServer('server_protocol', 'https'));
if($protocol === 'HTTP/1.1') {
return 'http';
}
return $this->getHeader('x-forwarded-proto', 'https');
return $protocol;
}
/**