Removed redundant items, upgraded to laravel 5.6
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Closure;
|
||||
use App\Models\{Site};
|
||||
use Config;
|
||||
@@ -26,10 +27,15 @@ class SetSite
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
// @todo Figure out how to know if this is an API call - and deny it if it's not in the database.
|
||||
$so = Site::where('url',$request->root())
|
||||
->orwhere('devurl',$request->root())
|
||||
// @todo With an API call, we would use ->firstorfail();
|
||||
->first();
|
||||
$so = NULL;
|
||||
|
||||
if (Schema::hasTable('site'))
|
||||
{
|
||||
$so = Site::where('url',$request->root())
|
||||
->orwhere('devurl',$request->root())
|
||||
// @todo With an API call, we would use ->firstorfail();
|
||||
->first();
|
||||
}
|
||||
|
||||
// If we dont exist, we'll return a fake model.
|
||||
if (! $so) {
|
||||
|
@@ -15,15 +15,9 @@ class TrustProxies extends Middleware
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The current proxy header mappings.
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var array
|
||||
* @var string
|
||||
*/
|
||||
protected $headers = [
|
||||
Request::HEADER_FORWARDED => 'FORWARDED',
|
||||
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
|
||||
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
|
||||
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
|
||||
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
|
||||
];
|
||||
protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user