This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/HttpKernel/Tests/Fragment
Fabien Potencier 2f3b33a630 merged branch guilhermeblanco/client_ip_fix (PR #7559)
This PR was squashed before being merged into the master branch (closes #7559).

Discussion
----------

[HttpFoundation] [HttpKernel] Internal sub-requests should have X-Forwarded-For header providing real client IP

This is a better alternative to fix issue highlighted in #7554 and #7557.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7554, #7557
| License       | MIT

When dealing with inline fragment renderer, it emulates an internal request by overriding the REMOTE_ADDR on Request. This is true, since conceptually request came from local server.
The problem that this introduces is that overriding the server value, it turns into an impossible state to retrieve the real client ip, only returning the local server IP (which is hardcoded to 127.0.0.1).

This patch takes the same approach as a Varnish call (it behaves the exact same way, reusing all code built for handling client ip handling on sub-requests), populating the X-Forwarded-For header and also making getClientIp smarter by removing possible local IP addresses from being considered as the client IP address.

Commits
-------

773e109 [HttpFoundation] [HttpKernel] Internal sub-requests should have X-Forwarded-For header providing real client IP
2013-04-21 09:39:54 +02:00
..
EsiFragmentRendererTest.php renamed some classes and Twig functions to more descriptive names (refs #6871) 2013-02-01 15:17:20 +01:00
FragmentHandlerTest.php merged branch fabpot/contagious-services (PR #7007) 2013-03-23 14:07:03 +01:00
HIncludeFragmentRendererTest.php [HttpKernel] added escaping for hx:include tag attributes 2013-03-29 05:29:22 +01:00
InlineFragmentRendererTest.php merged branch guilhermeblanco/client_ip_fix (PR #7559) 2013-04-21 09:39:54 +02:00
RoutableFragmentRendererTest.php renamed some classes and Twig functions to more descriptive names (refs #6871) 2013-02-01 15:17:20 +01:00