Skip to content

Commit 286f64f

Browse files
author
Peter Bex
committed
Make Request::isFromTrustedProxy() public.
Also add documentation so we know what it can be used for.
1 parent f29d46f commit 286f64f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,15 @@ private static function createRequestFromFactory(array $query = array(), array $
19311931
return new static($query, $request, $attributes, $cookies, $files, $server, $content);
19321932
}
19331933

1934-
private function isFromTrustedProxy()
1934+
/**
1935+
* Indicates whether this request originated from a trusted proxy.
1936+
*
1937+
* This can be useful to determine whether or not to trust the
1938+
* contents of a proxy-specific header.
1939+
*
1940+
* @return bool true if the request came from a trusted proxy, false otherwise
1941+
*/
1942+
public function isFromTrustedProxy()
19351943
{
19361944
return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR'), self::$trustedProxies);
19371945
}

0 commit comments

Comments
 (0)