Use fideloper/TrustedProxy for proxy issues. Part of #370

This commit is contained in:
James Brooks 2015-01-16 08:36:29 +00:00
parent cadaa49599
commit a25b12914a
4 changed files with 102 additions and 2 deletions

View File

@ -136,6 +136,7 @@ return [
'Jenssegers\Date\DateServiceProvider',
'McCool\LaravelAutoPresenter\LaravelAutoPresenterServiceProvider',
'PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider',
'Fideloper\Proxy\ProxyServiceProvider',
/*
* Application Service Providers...

View File

@ -0,0 +1,51 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Trusted Proxies
|--------------------------------------------------------------------------
|
| Set an array of trusted proxies, so Laravel knows to grab the client's
| information via the X-Forwarded-* headers.
|
| To trust all proxies, use the value '*':
|
| 'proxies' => '*'
|
|
| To trust only specific proxies (recommended), set an array of those
| proxies' IP addresses:
|
| 'proxies' => array('192.168.1.1', '192.168.1.2')
|
|
| Or use CIDR notation:
|
| 'proxies' => array('192.168.12.0/23')
|
*/
'proxies' => array(
'204.93.240.0',
'204.93.177.0',
'199.27.128.0',
'173.245.48.0',
'103.21.244.0',
'103.22.200.0',
'103.31.4.0',
'141.101.64.0',
'108.162.192.0',
'190.93.240.0',
'188.114.96.0',
'197.234.240.0',
'198.41.128.0',
'162.158.0.0',
'2400:cb00::',
'2606:4700::',
'2803:f800::',
'2405:b500::',
'2405:8100::',
)
);

View File

@ -24,7 +24,8 @@
"pragmarx/google2fa": "0.1.*",
"roumen/feed": "2.8.*",
"thujohn/rss": "1.0.*",
"watson/validating": "0.10.*"
"watson/validating": "0.10.*",
"fideloper/proxy": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "~4.3",

49
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "17e49b071003f48bf48a5d636ef0991d",
"hash": "7f388e67b62f93a2298f701f263b461c",
"packages": [
{
"name": "classpreloader/classpreloader",
@ -712,6 +712,53 @@
],
"time": "2015-01-10 13:53:42"
},
{
"name": "fideloper/proxy",
"version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/fideloper/TrustedProxy.git",
"reference": "a0ec0f35c82dceecc0d8975f29e6e8e85acbd419"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/a0ec0f35c82dceecc0d8975f29e6e8e85acbd419",
"reference": "a0ec0f35c82dceecc0d8975f29e6e8e85acbd419",
"shasum": ""
},
"require": {
"illuminate/support": "~4.0|~5.0",
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-0": {
"Fideloper\\Proxy": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Chris Fidao",
"email": "fideloper@gmail.com"
}
],
"description": "Set trusted proxies for Laravel",
"keywords": [
"load balancing",
"proxy",
"trusted proxy"
],
"time": "2014-11-20 02:20:43"
},
{
"name": "filp/whoops",
"version": "1.1.3",