[HttpFoundation] added missing trustProxy condition
This commit is contained in:
parent
02a12b2c5c
commit
d67d419f3c
@ -562,7 +562,11 @@ class Request
|
|||||||
*/
|
*/
|
||||||
public function getPort()
|
public function getPort()
|
||||||
{
|
{
|
||||||
return $this->headers->get('X-Forwarded-Port') ?: $this->server->get('SERVER_PORT');
|
if (self::$trustProxy && $this->headers->has('X-Forwarded-Port')) {
|
||||||
|
return $this->headers->get('X-Forwarded-Port');
|
||||||
|
} else {
|
||||||
|
return $this->server->get('SERVER_PORT');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user