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
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
..
Bundle class_exists was returning fals for the container aware interface 2012-07-09 09:02:51 -07:00
CacheClearer moved component and bridge unit tests to the src/ directory 2012-03-29 08:37:22 +02:00
CacheWarmer moved component and bridge unit tests to the src/ directory 2012-03-29 08:37:22 +02:00
Config [HttpKernel] tweaked previous merge 2013-04-07 17:51:54 +02:00
Controller [HttpKernel] allowed any callable to be returned by ControllerResolver::createController 2013-04-20 22:13:18 +02:00
DataCollector Add support for detection of Zend OPcache as an accelerator 2013-04-14 21:00:45 -07:00
Debug [HttpKernel] Improve TraceableEventDispatcher to not call Stopwatch::stop() when not started 2013-04-12 17:56:02 +02:00
DependencyInjection [HttpKernel] fixed tests as addScope() is now called first 2013-03-23 14:37:49 +01:00
EventListener fix overwriting of request's locale if attribute _locale is missing 2013-03-28 23:37:30 +01:00
Fixtures [HttpKernel] fixed some unit tests 2012-11-12 14:30:42 +01:00
Fragment merged branch guilhermeblanco/client_ip_fix (PR #7559) 2013-04-21 09:39:54 +02:00
HttpCache Merge branch '2.1' into 2.2 2013-03-19 21:41:20 +01:00
Profiler [CS Fix] Consistent coding-style of concatenation operator usage 2013-04-02 10:39:57 +01:00
ClientTest.php [HttpFoundation] UploadedFile - moved a security check 2013-03-23 10:56:11 +01:00
HttpKernelTest.php Fixed @expectedException definitions to reference absolute exception paths 2013-01-05 18:52:40 +01:00
KernelTest.php [HttpKernel] fix public Kernel::stripComments() 2012-12-13 17:56:02 +01:00
Logger.php Remove use of deprecated HttpKernel LoggerInterface 2013-01-09 10:52:29 +01:00
TestHttpKernel.php moved component and bridge unit tests to the src/ directory 2012-03-29 08:37:22 +02:00
UriSignerTest.php added some unit tests (and fixed some bugs) 2013-01-10 16:26:59 +01:00