Skip to content

Commit

Permalink
fix: remove $allowedHostnames check
Browse files Browse the repository at this point in the history
SiteURI will check.
  • Loading branch information
kenjis committed Jun 29, 2023
1 parent f5073a8 commit 9784bb9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions system/HTTP/SiteURI.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ class SiteURI extends URI
/**
* @param string $relativePath URI path relative to baseURL. May include
* queries or fragments.
* @param string|null $host Optional hostname. If it is not in
* $allowedHostnames, just be ignored.
* @param string|null $host Optional current hostname.
* @param string|null $scheme Optional scheme. 'http' or 'https'.
* @phpstan-param 'http'|'https'|null $scheme
*/
Expand Down Expand Up @@ -153,7 +152,7 @@ private function determineBaseURL(
}

// Update host
if ($host !== null && $this->checkHost($host, $configApp->allowedHostnames)) {
if ($host !== null) {
$uri->setHost($host);
}

Expand Down Expand Up @@ -187,11 +186,6 @@ private function getIndexPageRoutePath(string $routePath): string
return $indexPageRoutePath;
}

private function checkHost(string $host, array $allowedHostnames): bool
{
return in_array($host, $allowedHostnames, true);
}

private function normalizeBaseURL(App $configApp): string
{
// It's possible the user forgot a trailing slash on their
Expand Down

0 comments on commit 9784bb9

Please sign in to comment.