Skip to content

Commit 5639581

Browse files
committed
add basic trust host middleware
1 parent c104891 commit 5639581

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

app/Http/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Kernel extends HttpKernel
1414
* @var array
1515
*/
1616
protected $middleware = [
17+
// \App\Http\Middleware\TrustHosts::class,
1718
\App\Http\Middleware\TrustProxies::class,
1819
\Fruitcake\Cors\HandleCors::class,
1920
\App\Http\Middleware\CheckForMaintenanceMode::class,

app/Http/Middleware/TrustHosts.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Http\Middleware\TrustHosts as Middleware;
6+
7+
class TrustHosts extends Middleware
8+
{
9+
/**
10+
* Get the host patterns that should be trusted.
11+
*
12+
* @return array
13+
*/
14+
public function hosts()
15+
{
16+
return [
17+
$this->allSubdomainsOfApplicationUrl(),
18+
];
19+
}
20+
}

0 commit comments

Comments
 (0)