mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
(captiveportal, new) only accept X-Forwarded-For from localhost, thanks @fabianfrz
This commit is contained in:
parent
96b033104d
commit
7c39adf71a
@ -73,7 +73,8 @@ class AccessController extends ApiControllerBase
|
||||
private function getClientIp()
|
||||
{
|
||||
// determine orginal sender of this request
|
||||
if ($this->request->getHeader('X-Forwarded-For') != "") {
|
||||
$trusted_proxy = array("127.0.0.1");
|
||||
if ($this->request->getHeader('X-Forwarded-For') != "" && in_array($this->request->getClientAddress(), $trusted_proxy) ) {
|
||||
// use X-Forwarded-For header to determine real client
|
||||
return $this->request->getHeader('X-Forwarded-For');
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user