updated-packages
This commit is contained in:
@@ -45,7 +45,7 @@ class RemoteAddress
|
||||
* at session read, so this is the only way to switch setting.
|
||||
*
|
||||
* @param bool $useProxy Whether to check also proxied IP addresses.
|
||||
* @return RemoteAddress
|
||||
* @return $this
|
||||
*/
|
||||
public function setUseProxy($useProxy = true)
|
||||
{
|
||||
@@ -67,7 +67,7 @@ class RemoteAddress
|
||||
* Set list of trusted proxy addresses
|
||||
*
|
||||
* @param array $trustedProxies
|
||||
* @return RemoteAddress
|
||||
* @return $this
|
||||
*/
|
||||
public function setTrustedProxies(array $trustedProxies)
|
||||
{
|
||||
@@ -79,7 +79,7 @@ class RemoteAddress
|
||||
* Set the header to introspect for proxy IPs
|
||||
*
|
||||
* @param string $header
|
||||
* @return RemoteAddress
|
||||
* @return $this
|
||||
*/
|
||||
public function setProxyHeader($header = 'X-Forwarded-For')
|
||||
{
|
||||
|
||||
@@ -107,7 +107,7 @@ class Request extends HttpRequest
|
||||
* Instantiate and set cookies.
|
||||
*
|
||||
* @param $cookie
|
||||
* @return Request
|
||||
* @return $this
|
||||
*/
|
||||
public function setCookies($cookie)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ class Request extends HttpRequest
|
||||
* Set the request URI.
|
||||
*
|
||||
* @param string $requestUri
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
public function setRequestUri($requestUri)
|
||||
{
|
||||
@@ -144,7 +144,7 @@ class Request extends HttpRequest
|
||||
* Set the base URL.
|
||||
*
|
||||
* @param string $baseUrl
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
public function setBaseUrl($baseUrl)
|
||||
{
|
||||
@@ -169,7 +169,7 @@ class Request extends HttpRequest
|
||||
* Set the base path.
|
||||
*
|
||||
* @param string $basePath
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
public function setBasePath($basePath)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ class Request extends HttpRequest
|
||||
* (this is NOT the primary API for value setting, for that see getServer())
|
||||
*
|
||||
* @param ParametersInterface $server
|
||||
* @return Request
|
||||
* @return $this
|
||||
*/
|
||||
public function setServer(ParametersInterface $server)
|
||||
{
|
||||
@@ -266,8 +266,9 @@ class Request extends HttpRequest
|
||||
$port = null;
|
||||
|
||||
// Set the host
|
||||
if ($this->getHeaders()->get('host')) {
|
||||
$host = $this->getHeaders()->get('host')->getFieldValue();
|
||||
$headerHost = $this->getHeaders()->get('host');
|
||||
if ($headerHost) {
|
||||
$host = $headerHost->getFieldValue();
|
||||
|
||||
// works for regname, IPv4 & IPv6
|
||||
if (preg_match('|\:(\d+)$|', $host, $matches)) {
|
||||
@@ -351,7 +352,7 @@ class Request extends HttpRequest
|
||||
* (this is NOT the primary API for value setting, for that see env())
|
||||
*
|
||||
* @param ParametersInterface $env
|
||||
* @return Request
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnv(ParametersInterface $env)
|
||||
{
|
||||
@@ -489,6 +490,15 @@ class Request extends HttpRequest
|
||||
// Backtrack up the SCRIPT_FILENAME to find the portion
|
||||
// matching PHP_SELF.
|
||||
|
||||
// Only for CLI requests argv[0] contains script filename
|
||||
// @see https://www.php.net/manual/en/reserved.variables.server.php
|
||||
if (PHP_SAPI === 'cli') {
|
||||
$argv = $this->getServer()->get('argv', []);
|
||||
if (isset($argv[0]) && is_string($argv[0]) && $argv[0] !== '' && strpos($filename, $argv[0]) === 0) {
|
||||
$filename = substr($filename, strlen($argv[0]));
|
||||
}
|
||||
}
|
||||
|
||||
$baseUrl = '/';
|
||||
$basename = basename($filename);
|
||||
if ($basename) {
|
||||
|
||||
@@ -76,7 +76,7 @@ class Response extends HttpResponse
|
||||
/**
|
||||
* Send HTTP headers
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function sendHeaders()
|
||||
{
|
||||
@@ -103,7 +103,7 @@ class Response extends HttpResponse
|
||||
/**
|
||||
* Send content
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function sendContent()
|
||||
{
|
||||
@@ -119,7 +119,7 @@ class Response extends HttpResponse
|
||||
/**
|
||||
* Send HTTP response
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function send()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user