Page MenuHomeDevCentral

Get remote address
ClosedPublic

Authored by dereckson on Apr 20 2018, 20:09.
Tags
None
Referenced Files
F2904218: D1623.diff
Tue, May 7, 08:00
Unknown Object (File)
Fri, May 3, 12:09
Unknown Object (File)
Mon, Apr 29, 13:33
Unknown Object (File)
Fri, Apr 26, 14:54
Unknown Object (File)
Thu, Apr 25, 04:25
Unknown Object (File)
Thu, Apr 25, 00:58
Unknown Object (File)
Thu, Apr 18, 04:24
Unknown Object (File)
Fri, Apr 12, 12:02
Subscribers
None

Details

Summary

Provide a Request::getRemoteAddress() to use instead of
$_SERVER['REMOTE_ADDR'] to be proxy compliant.

Security

The web server is trusted to clean headers and only forward to
the PHP processes the whitelisted headers, with validated values
or with values determines by the server.

This plays very well with scenarii like nginx front-end, nginx back-end
and php-fpm.

Ref T1395

Test Plan

Unit tests are provided, from rKGF

Diff Detail

Repository
rKOT Keruald OmniTools
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson created this revision.

Add declare(strict_types=1);

This revision is now accepted and ready to land.Apr 20 2018, 20:21
This revision was automatically updated to reflect the committed changes.