- Fixed HTTP_X_FORWARDED_HOST provided host
This commit is contained in:
1 parent
131204d838
commit
0f95171575
1 file changed
+6
@@ -210,9 +210,15 @@ PATTERN;
|
||||
|
||||
protected function domain() : string
|
||||
{
|
||||
# Forwarded from an SSL connected host
|
||||
if ( ! empty($_SERVER['HTTP_X_FORWARDED_PROTO']) || ! empty($_SERVER['HTTP_X_FORWARDED_SSL']) ) {
|
||||
$port = "";
|
||||
}
|
||||
# Forwarded from another host
|
||||
elseif ( !empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
|
||||
$port = explode(':', $_SERVER['HTTP_X_FORWARDED_HOST'])[1] ?? "";
|
||||
}
|
||||
# Default
|
||||
else {
|
||||
$port = $this->isDefaultPort() ? "" : ":" . $_SERVER['SERVER_PORT'];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user