Page MenuHomeDevCentral

Get remote address
ClosedPublic

Authored by dereckson on Apr 20 2018, 20:09.
Tags
None
Referenced Files
F2824179: D1623.id4146.diff
Thu, Apr 18, 04:24
Unknown Object (File)
Fri, Apr 12, 12:02
Unknown Object (File)
Wed, Apr 10, 09:37
Unknown Object (File)
Wed, Apr 10, 09:37
Unknown Object (File)
Wed, Apr 10, 09:37
Unknown Object (File)
Mon, Apr 8, 19:20
Unknown Object (File)
Sun, Apr 7, 04:38
Unknown Object (File)
Fri, Apr 5, 14:26
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 Passed
Unit
Tests Passed
Branch
remote_addr (branched from master)
Build Status
Buildable 2548
Build 2796: arc lint + arc unit

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.