Import Request in trustedproxy.php

This commit is contained in:
James Brooks
2015-04-19 09:13:20 +01:00
parent 861041ff31
commit 8714f4643d

View File

@@ -9,19 +9,24 @@
* file that was distributed with this source code.
*/
use Illuminate\Http\Request;
return [
/*
* Set trusted proxy IP addresses.
*
* Both IPv4 and IPv6 addresses are
* supported, along with CIDR notation.
*
* The "*" character is syntactic sugar
* within TrustedProxy to trust any proxy;
* a requirement when you cannot know the address
* of your proxy (e.g. if using Rackspace balancers).
*/
|--------------------------------------------------------------------------
| Trusted Proxies
|--------------------------------------------------------------------------
|
| Set trusted proxy IP addresses. Both IPv4 and IPv6 addresses are
| supported, along with CIDR notation. The "*" character is syntactic sugar
| within TrustedProxy to trust any proxy; a requirement when you cannot
| know the address of your proxy (e.g. if using Rackspace balancers).
|
| By default, we are trusting CloudFlare only.
|
*/
'proxies' => [
'204.93.240.0',
'204.93.177.0',
@@ -45,26 +50,23 @@ return [
],
/*
* Or, to trust all proxies, uncomment this:
*/
# 'proxies' => '*',
|--------------------------------------------------------------------------
| Respected Headers
|--------------------------------------------------------------------------
|
| Change these if the proxy does not send the default header names. Note
| that headers such as X-Forwarded-For are transformed to
| HTTP_X_FORWARDED_FOR format.
|
| By default, we are using the Symfony defaults.
|
*/
/*
* Default Header Names
*
* Change these if the proxy does
* not send the default header names.
*
* Note that headers such as X-Forwarded-For
* are transformed to HTTP_X_FORWARDED_FOR format.
*
* The following are Symfony defaults, found in
* \Symfony\Component\HttpFoundation\Request::$trustedHeaders
*/
'headers' => [
\Illuminate\Http\Request::HEADER_CLIENT_IP => 'X_FORWARDED_FOR',
\Illuminate\Http\Request::HEADER_CLIENT_HOST => 'X_FORWARDED_HOST',
\Illuminate\Http\Request::HEADER_CLIENT_PROTO => 'X_FORWARDED_PROTO',
\Illuminate\Http\Request::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT',
Request::HEADER_CLIENT_IP => 'X_FORWARDED_FOR',
Request::HEADER_CLIENT_HOST => 'X_FORWARDED_HOST',
Request::HEADER_CLIENT_PROTO => 'X_FORWARDED_PROTO',
Request::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT',
],
];