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/tests/Symfony/Tests/Component
Fabien Potencier 286ce0ea40 merged branch pulzarraider/proxy_ip_fix (PR #2695)
Commits
-------

11b6156 updated unittest
a931e21 get correct client IP from X-forwarded-for header

Discussion
----------

[HttpFoundation] Get correct client IP when using trusted proxy (Varnish)

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
Note: This is reopened PR #2686 for 2.0 branch.

If using trusted proxy (Varnish, ...) the client IP must be identified from X-Forwarded-For header. The header has de-facto standard format:

X-Forwarded-For : client1, proxy1, proxy2,

where the value is a comma+space separated list of IP addresses, the left-most being the farthest downstream client, and each successive proxy that passed the request adding the IP address where it received the request from. See: http://en.wikipedia.org/wiki/X-Forwarded-For

Function getClientIp should return only one client IP, not a list of all nonimportant IPs as it's now. Similar example can be seen in Cake framework: http://api.cakephp.org/view_source/request-handler-component/#line-477

There are many ways how to chose the first IP from X-Forwarded-For header. Any other faster and more reliable way is welcome.
2011-11-23 11:22:06 +01:00
..
BrowserKit [BrowserKit] Added additional unit tests for capital letters in cookies 2011-10-14 20:31:31 +01:00
ClassLoader [ClassLoader] Fixed state when trait_exists doesn't exists 2011-09-25 19:25:50 +02:00
Config removed unused use statements 2011-10-29 11:56:30 +02:00
Console removed unused use statements 2011-10-29 11:56:30 +02:00
CssSelector UnitTest 2011-06-29 18:22:32 +02:00
DependencyInjection removed unused use statements 2011-10-29 11:56:30 +02:00
DomCrawler [DomCrawler] trim URI in getURI 2011-11-10 15:38:28 +01:00
EventDispatcher [EventDispatcher] Fix removeSubscriber() to work with priority syntax 2011-08-23 16:41:08 -04:00
Finder [Finder] added a convenience method Finder::create() 2011-06-14 14:18:24 +02:00
Form [Form] added some unit tests 2011-11-22 10:31:25 +01:00
HttpFoundation updated unittest 2011-11-22 22:28:38 +01:00
HttpKernel Skipped tests when PDO is not available 2011-11-14 18:39:47 +01:00
Locale Set error code when number cannot be parsed. Fixes #2389 2011-10-30 22:02:16 +00:00
Process [Process] removed an incomplete test that cannot be fixed 2011-11-02 06:58:56 +01:00
Routing fixed CS 2011-10-29 12:03:59 +02:00
Security Skipped tests when PDO is not available 2011-11-14 18:39:47 +01:00
Serializer Updated SerializerTest with "normalizeTraversable" & "testNormalizeGivesPriorityToInterfaceOverTraversable" 2011-11-07 19:25:58 -08:00
Templating removed unused use statements 2011-10-29 11:56:30 +02:00
Translation [Translation] added detection for circular references when adding a fallback catalogue 2011-11-11 08:29:16 +01:00
Validator removed unused use statements 2011-10-29 11:56:30 +02:00
Yaml [Yaml][Tests] Fixed missing locale string for Windows platforms which caused test to fail 2011-11-10 12:50:53 +01:00