@@ -129,7 +129,7 @@ dependency for the project:
129129
130130 {
131131 " require" : {
132- " symfony/http-foundation" : " 2.1.* "
132+ " symfony/http-foundation" : " ~2.3 "
133133 }
134134 }
135135
@@ -170,8 +170,8 @@ first outputs the HTTP headers followed by the content).
170170 Before the ``send() `` call, we should have added a call to the
171171 ``prepare() `` method (``$response->prepare($request); ``) to ensure that
172172 our Response were compliant with the HTTP specification. For instance, if
173- we were to call the page with the ``HEAD `` method, it would have removed
174- the content of the Response.
173+ we were to call the page with the ``HEAD `` method, it would remove the
174+ content of the Response.
175175
176176The main difference with the previous code is that you have total control of
177177the HTTP messages. You can create whatever request you want and you are in
@@ -275,11 +275,12 @@ secure? The ``$_SERVER['HTTP_X_FORWARDED_FOR']`` value cannot be trusted as it
275275can be manipulated by the end user when there is no proxy. So, if you are
276276using this code in production without a proxy, it becomes trivially easy to
277277abuse your system. That's not the case with the ``getClientIp() `` method as
278- you must explicitly trust this header by calling ``trustProxyData() ``::
278+ you must explicitly trust your reverse proxies by calling
279+ ``setTrustedProxies() ``::
279280
280281 <?php
281282
282- Request::trustProxyData( );
283+ Request::setTrustedProxies(array('10.0.0.1') );
283284
284285 if ($myIp == $request->getClientIp(true)) {
285286 // the client is a known one, so give it some more privilege
@@ -302,9 +303,9 @@ Using just the Symfony2 HttpFoundation component already allows you to write
302303better and more testable code. It also allows you to write code faster as many
303304day-to-day problems have already been solved for you.
304305
305- As a matter of fact, projects like Drupal have adopted (for the upcoming
306- version 8) the HttpFoundation component; if it works for them, it will
307- probably work for you. Don't reinvent the wheel.
306+ As a matter of fact, projects like Drupal have adopted the HttpFoundation
307+ component; if it works for them, it will probably work for you. Don't reinvent
308+ the wheel.
308309
309310I've almost forgot to talk about one added benefit: using the HttpFoundation
310311component is the start of better interoperability between all frameworks and
0 commit comments