From 286f64f00caae6c2effeaafe824831f29035eb7c Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Wed, 16 Mar 2016 15:57:42 +0100 Subject: [PATCH] Make Request::isFromTrustedProxy() public. Also add documentation so we know what it can be used for. --- src/Symfony/Component/HttpFoundation/Request.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 95744743f45e5..3dfcb378a7163 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -1931,7 +1931,15 @@ private static function createRequestFromFactory(array $query = array(), array $ return new static($query, $request, $attributes, $cookies, $files, $server, $content); } - private function isFromTrustedProxy() + /** + * Indicates whether this request originated from a trusted proxy. + * + * This can be useful to determine whether or not to trust the + * contents of a proxy-specific header. + * + * @return bool true if the request came from a trusted proxy, false otherwise + */ + public function isFromTrustedProxy() { return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR'), self::$trustedProxies); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy