12345678910111213141516171819202122232425262728293031323334 |
- <?php
- use Symfony\Component\HttpFoundation\Request;
- $loader = require __DIR__.'/../app/autoload.php';
- $kernel = new AppKernel('prod', false);
- if (PHP_VERSION_ID < 70100) {
- if (in_array($_SERVER['REMOTE_ADDR'], ['144.217.203.53', '54.38.136.239', '54.37.131.18', '142.44.164.249', '142.44.164.255', '54.37.2.184', '139.99.121.122', '54.37.4.73', '51.38.227.34'], true)) {
- Request::setTrustedProxies([$_SERVER['REMOTE_ADDR']]);
-
- Request::setTrustedHeaderName(Request::HEADER_FORWARDED, '');
- Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, 'X_REAL_IP');
- Request::setTrustedHeaderName(Request::HEADER_CLIENT_HOST, '');
- Request::setTrustedHeaderName(Request::HEADER_CLIENT_PROTO, '');
- Request::setTrustedHeaderName(Request::HEADER_CLIENT_PORT, '');
- }
- } else {
- Request::setTrustedProxies(
-
-
- [$_SERVER['REMOTE_ADDR']],
-
- Request::HEADER_X_FORWARDED_AWS_ELB ^ Request::HEADER_X_FORWARDED_FOR
- );
- }
- $request = Request::createFromGlobals();
- $response = $kernel->handle($request);
- $response->send();
- $kernel->terminate($request, $response);
|