Page MenuHomeDevCentral

Get remote address
ClosedPublic

Authored by dereckson on Apr 20 2018, 20:09.
Tags
None
Referenced Files
F3911952: D1623.diff
Thu, Dec 19, 04:35
Unknown Object (File)
Wed, Dec 11, 22:24
Unknown Object (File)
Mon, Dec 9, 04:06
Unknown Object (File)
Mon, Dec 9, 04:06
Unknown Object (File)
Mon, Dec 9, 04:06
Unknown Object (File)
Mon, Dec 9, 04:06
Unknown Object (File)
Sat, Nov 23, 16:10
Unknown Object (File)
Sat, Nov 23, 16:10
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 2546
Build 2794: 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.