Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
5eedeeb7
Unverified
Commit
5eedeeb7
authored
Sep 02, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Middleware
parent
0c971ef7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
7 deletions
+61
-7
Kernel.php
app/Http/Kernel.php
+9
-2
EncryptCookies.php
app/Http/Middleware/EncryptCookies.php
+2
-2
RedirectIfAuthenticated.php
app/Http/Middleware/RedirectIfAuthenticated.php
+1
-1
TrimStrings.php
app/Http/Middleware/TrimStrings.php
+18
-0
TrustProxies.php
app/Http/Middleware/TrustProxies.php
+29
-0
VerifyCsrfToken.php
app/Http/Middleware/VerifyCsrfToken.php
+2
-2
No files found.
app/Http/Kernel.php
View file @
5eedeeb7
...
@@ -15,7 +15,12 @@ class Kernel extends HttpKernel
...
@@ -15,7 +15,12 @@ class Kernel extends HttpKernel
*/
*/
protected
$middleware
=
[
protected
$middleware
=
[
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode
::
class
,
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode
::
class
,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize
::
class
,
\App\Http\Middleware\TrimStrings
::
class
,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull
::
class
,
\App\Http\Middleware\TrustProxies
::
class
,
];
];
/**
/**
* The application's route middleware groups.
* The application's route middleware groups.
*
*
...
@@ -26,15 +31,18 @@ class Kernel extends HttpKernel
...
@@ -26,15 +31,18 @@ class Kernel extends HttpKernel
\App\Http\Middleware\EncryptCookies
::
class
,
\App\Http\Middleware\EncryptCookies
::
class
,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse
::
class
,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse
::
class
,
\Illuminate\Session\Middleware\StartSession
::
class
,
\Illuminate\Session\Middleware\StartSession
::
class
,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession
::
class
,
\Illuminate\View\Middleware\ShareErrorsFromSession
::
class
,
\App\Http\Middleware\VerifyCsrfToken
::
class
,
\Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
\Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
\App\Http\Middleware\VerifyCsrfToken
::
class
,
],
],
'api'
=>
[
'api'
=>
[
'throttle:60,1'
,
'throttle:60,1'
,
'bindings'
,
'bindings'
,
],
],
];
];
/**
/**
* The application's route middleware.
* The application's route middleware.
*
*
...
@@ -44,7 +52,6 @@ class Kernel extends HttpKernel
...
@@ -44,7 +52,6 @@ class Kernel extends HttpKernel
*/
*/
protected
$routeMiddleware
=
[
protected
$routeMiddleware
=
[
'auth'
=>
\Illuminate\Auth\Middleware\Authenticate
::
class
,
'auth'
=>
\Illuminate\Auth\Middleware\Authenticate
::
class
,
'auth.basic'
=>
\Illuminate\Auth\Middleware\AuthenticateWithBasicAuth
::
class
,
'bindings'
=>
\Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
'bindings'
=>
\Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
// 'can' => \Illuminate\Auth\Middleware\Authorize::class,
// 'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest'
=>
\App\Http\Middleware\RedirectIfAuthenticated
::
class
,
'guest'
=>
\App\Http\Middleware\RedirectIfAuthenticated
::
class
,
...
...
app/Http/Middleware/EncryptCookies.php
View file @
5eedeeb7
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
namespace
App\Http\Middleware
;
namespace
App\Http\Middleware
;
use
Illuminate\Cookie\Middleware\EncryptCookies
as
BaseEncrypter
;
use
Illuminate\Cookie\Middleware\EncryptCookies
as
Middleware
;
class
EncryptCookies
extends
BaseEncrypter
class
EncryptCookies
extends
Middleware
{
{
/**
/**
* The names of the cookies that should not be encrypted.
* The names of the cookies that should not be encrypted.
...
...
app/Http/Middleware/RedirectIfAuthenticated.php
View file @
5eedeeb7
...
@@ -18,7 +18,7 @@ class RedirectIfAuthenticated
...
@@ -18,7 +18,7 @@ class RedirectIfAuthenticated
public
function
handle
(
$request
,
Closure
$next
,
$guard
=
null
)
public
function
handle
(
$request
,
Closure
$next
,
$guard
=
null
)
{
{
if
(
Auth
::
guard
(
$guard
)
->
check
())
{
if
(
Auth
::
guard
(
$guard
)
->
check
())
{
return
redirect
(
'/'
);
return
redirect
(
'/
home
'
);
}
}
return
$next
(
$request
);
return
$next
(
$request
);
...
...
app/Http/Middleware/TrimStrings.php
0 → 100644
View file @
5eedeeb7
<?php
namespace
App\Http\Middleware
;
use
Illuminate\Foundation\Http\Middleware\TrimStrings
as
Middleware
;
class
TrimStrings
extends
Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array
*/
protected
$except
=
[
'password'
,
'password_confirmation'
,
];
}
app/Http/Middleware/TrustProxies.php
0 → 100644
View file @
5eedeeb7
<?php
namespace
App\Http\Middleware
;
use
Illuminate\Http\Request
;
use
Fideloper\Proxy\TrustProxies
as
Middleware
;
class
TrustProxies
extends
Middleware
{
/**
* The trusted proxies for this application.
*
* @var array
*/
protected
$proxies
;
/**
* The current proxy header mappings.
*
* @var array
*/
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'
,
];
}
app/Http/Middleware/VerifyCsrfToken.php
View file @
5eedeeb7
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
namespace
App\Http\Middleware
;
namespace
App\Http\Middleware
;
use
Illuminate\Foundation\Http\Middleware\VerifyCsrfToken
as
BaseVerifier
;
use
Illuminate\Foundation\Http\Middleware\VerifyCsrfToken
as
Middleware
;
class
VerifyCsrfToken
extends
BaseVerifier
class
VerifyCsrfToken
extends
Middleware
{
{
/**
/**
* The URIs that should be excluded from CSRF verification.
* The URIs that should be excluded from CSRF verification.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment