Skip to content

Commit

Permalink
HTTP_X_FORWARDED_PROTO first
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Mar 16, 2024
1 parent eeb8e44 commit f30f1da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nexus/Nexus.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function isScriptAnnounce(): bool
return $this->script == 'announce';
}

public function incrementLogSequence()
public function incrementLogSequence(): void
{
$this->logSequence++;
}
Expand All @@ -108,7 +108,7 @@ private function getFirst(string $result): string
return $result;
}

public function getRequestSchema()
public function getRequestSchema(): string
{
$schema = $this->retrieveFromServer(['HTTP_X_FORWARDED_PROTO', 'REQUEST_SCHEME', 'HTTP_SCHEME']);
if (empty($schema)) {
Expand All @@ -122,7 +122,7 @@ public function getRequestSchema()

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));
}

Expand Down

0 comments on commit f30f1da

Please sign in to comment.