Page MenuHomeDevCentral

Get remote address
ClosedPublic

Authored by dereckson on Apr 20 2018, 20:09.
Tags
None
Referenced Files
F2745091: D1623.diff
Thu, Mar 28, 21:30
Unknown Object (File)
Sat, Mar 23, 09:46
Unknown Object (File)
Fri, Mar 22, 02:11
Unknown Object (File)
Wed, Mar 20, 10:08
Unknown Object (File)
Tue, Mar 19, 01:29
Unknown Object (File)
Mon, Mar 18, 07:57
Unknown Object (File)
Sun, Mar 17, 09:27
Unknown Object (File)
Thu, Feb 29, 16:00
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 2547
Build 2795: 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.