You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @deprecated code path in 3.3, to be replaced by mandatory argument in 4.0.
581
-
thrownew \InvalidArgumentException(sprintf('The %s() method expects a bit field of Request::HEADER_* as second argument. Defining it is required since version 3.3. See http://symfony.com/doc/current/components/http_foundation/trusting_proxies.html for more info.', __METHOD__));
@@ -634,65 +604,6 @@ public static function getTrustedHosts()
634
604
returnself::$trustedHostPatterns;
635
605
}
636
606
637
-
/**
638
-
* Sets the name for trusted headers.
639
-
*
640
-
* The following header keys are supported:
641
-
*
642
-
* * Request::HEADER_CLIENT_IP: defaults to X-Forwarded-For (see getClientIp())
643
-
* * Request::HEADER_CLIENT_HOST: defaults to X-Forwarded-Host (see getHost())
644
-
* * Request::HEADER_CLIENT_PORT: defaults to X-Forwarded-Port (see getPort())
645
-
* * Request::HEADER_CLIENT_PROTO: defaults to X-Forwarded-Proto (see getScheme() and isSecure())
646
-
* * Request::HEADER_FORWARDED: defaults to Forwarded (see RFC 7239)
647
-
*
648
-
* Setting an empty value allows to disable the trusted header for the given key.
649
-
*
650
-
* @param string $key The header key
651
-
* @param string $value The header name
652
-
*
653
-
* @throws \InvalidArgumentException
654
-
*
655
-
* @deprecated since version 3.3, to be removed in 4.0. Use "X-Forwarded-*" headers or the "Forwarded" header defined in RFC7239, and the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.
@trigger_error(sprintf('The "%s()" method is deprecated since version 3.3 and will be removed in 4.0. Use "X-Forwarded-*" headers or the "Forwarded" header defined in RFC7239, and the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.', __METHOD__), E_USER_DEPRECATED);
660
-
661
-
if (!array_key_exists($key, self::$trustedHeaders)) {
662
-
thrownew \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key));
663
-
}
664
-
665
-
self::$trustedHeaders[$key] = $value;
666
-
667
-
if (null !== $value) {
668
-
self::$trustedHeaderNames[$key] = $value;
669
-
}
670
-
}
671
-
672
-
/**
673
-
* Gets the trusted proxy header name.
674
-
*
675
-
* @param string $key The header key
676
-
*
677
-
* @return string The header name
678
-
*
679
-
* @throws \InvalidArgumentException
680
-
*
681
-
* @deprecated since version 3.3, to be removed in 4.0. Use the Request::getTrustedHeaderSet() method instead.
682
-
*/
683
-
publicstaticfunctiongetTrustedHeaderName($key)
684
-
{
685
-
if (2 > func_num_args() || func_get_arg(1)) {
686
-
@trigger_error(sprintf('The "%s()" method is deprecated since version 3.3 and will be removed in 4.0. Use the Request::getTrustedHeaderSet() method instead.', __METHOD__), E_USER_DEPRECATED);
687
-
}
688
-
689
-
if (!array_key_exists($key, self::$trustedHeaders)) {
690
-
thrownew \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key));
691
-
}
692
-
693
-
returnself::$trustedHeaders[$key];
694
-
}
695
-
696
607
/**
697
608
* Normalizes a query string.
698
609
*
@@ -860,7 +771,7 @@ public function getClientIps()
// This deprecation should be turned into a BadMethodCallException in 4.0 (without adding the argument in the signature)
1524
-
// then setting $andCacheable to false should be deprecated in 4.1
1525
-
@trigger_error('Checking only for cacheable HTTP methods with Symfony\Component\HttpFoundation\Request::isMethodSafe() is deprecated since version 3.2 and will throw an exception in 4.0. Disable checking only for cacheable methods by calling the method with `false` as first argument or use the Request::isMethodCacheable() instead.', E_USER_DEPRECATED);
// setting $andCacheable to false should be deprecated in 4.1
1435
+
thrownew \BadMethodCallException('Checking only for cacheable HTTP methods with Symfony\Component\HttpFoundation\Request::isMethodSafe() is not supported.', E_USER_DEPRECATED);
0 commit comments