File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,18 @@ In this case, you'll need to - *very carefully* - trust *all* proxies.
65
65
66
66
// ...
67
67
Request::setTrustedProxies(
68
- // trust *all* requests
69
- ['127.0.0.1', $request->server->get('REMOTE_ADDR')],
68
+ // trust *all* requests (the 'REMOTE_ADDR' string is replaced at
69
+ // run time by $_SERVER['REMOTE_ADDR'])
70
+ ['127.0.0.1', 'REMOTE_ADDR'],
70
71
71
72
// if you're using ELB, otherwise use a constant from above
72
73
Request::HEADER_X_FORWARDED_AWS_ELB
73
74
);
74
75
76
+ .. versionadded :: 4.4
77
+
78
+ The support for the ``REMOTE_ADDR `` option was introduced in Symfony 4.4.
79
+
75
80
That's it! It's critical that you prevent traffic from all non-trusted sources.
76
81
If you allow outside traffic, they could "spoof" their true IP address and
77
82
other information.
You can’t perform that action at this time.
0 commit comments