Commit d45ba3ed authored by Frederic G. MARAND's avatar Frederic G. MARAND

Doc: trustProxyData() is now replaced by setTrustedProxies().

parent a0b5f746
...@@ -53,11 +53,12 @@ setting Response HTTP cache headers:: ...@@ -53,11 +53,12 @@ setting Response HTTP cache headers::
.. tip:: .. tip::
If you want Silex to trust the ``X-Forwarded-For*`` headers from your If you want Silex to trust the ``X-Forwarded-For*`` headers from your
reverse proxy, you will need to run your application like this:: reverse proxy at address $ip, you will need to run your application like
this::
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
Request::trustProxyData(); Request::setTrustedProxies(array($ip));
$app->run(); $app->run();
This provider allows you to use the Symfony2 reverse proxy natively with This provider allows you to use the Symfony2 reverse proxy natively with
......
...@@ -79,13 +79,13 @@ Then, you have to configure your web server (read the :doc:`dedicated chapter ...@@ -79,13 +79,13 @@ Then, you have to configure your web server (read the :doc:`dedicated chapter
.. tip:: .. tip::
If your application is hosted behind a reverse proxy and you want Silex to If your application is hosted behind a reverse proxy at address $ip, and you
trust the ``X-Forwarded-For*`` headers, you will need to run your want Silex to trust the ``X-Forwarded-For*`` headers, you will need to run
application like this:: your application like this::
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
Request::trustProxyData(); Request::setTrustedProxies(array($ip));
$app->run(); $app->run();
Routing Routing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment