HTTP_X_FORWARDED_PROTO first

This commit is contained in:
xiaomlove
2024-03-16 22:17:31 +08:00
parent eeb8e44cab
commit f30f1da201
+3 -3
View File
@@ -95,7 +95,7 @@ final class Nexus
return $this->script == 'announce'; return $this->script == 'announce';
} }
public function incrementLogSequence() public function incrementLogSequence(): void
{ {
$this->logSequence++; $this->logSequence++;
} }
@@ -108,7 +108,7 @@ final class Nexus
return $result; return $result;
} }
public function getRequestSchema() public function getRequestSchema(): string
{ {
$schema = $this->retrieveFromServer(['HTTP_X_FORWARDED_PROTO', 'REQUEST_SCHEME', 'HTTP_SCHEME']); $schema = $this->retrieveFromServer(['HTTP_X_FORWARDED_PROTO', 'REQUEST_SCHEME', 'HTTP_SCHEME']);
if (empty($schema)) { if (empty($schema)) {
@@ -122,7 +122,7 @@ final class Nexus
public function getRequestHost(): string public function getRequestHost(): string
{ {
$host = $this->retrieveFromServer(['HTTP_HOST', 'host', 'HTTP_X_FORWARDED_HOST'], true); $host = $this->retrieveFromServer(['HTTP_X_FORWARDED_HOST', 'HTTP_HOST', 'host'], true);
return $this->getFirst(strval($host)); return $this->getFirst(strval($host));
} }