Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetaGerMaps
Frontend
Commits
fab282b5
Commit
fab282b5
authored
9 months ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
fixes trustproxies
parent
adf63136
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/app/Http/Middleware/StartSession.php
+0
-20
0 additions, 20 deletions
app/app/Http/Middleware/StartSession.php
app/app/Http/Middleware/TrustProxies.php
+0
-35
0 additions, 35 deletions
app/app/Http/Middleware/TrustProxies.php
app/bootstrap/app.php
+8
-0
8 additions, 0 deletions
app/bootstrap/app.php
with
8 additions
and
55 deletions
app/app/Http/Middleware/StartSession.php
deleted
100644 → 0
+
0
−
20
View file @
adf63136
<?php
namespace
App\Http\Middleware
;
use
Closure
;
use
Illuminate\Http\Request
;
use
Symfony\Component\HttpFoundation\Response
;
class
StartSession
extends
\Illuminate\Session\Middleware\StartSession
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public
function
handleStatefulRequest
(
$request
,
$session
,
Closure
$next
):
Response
{
return
$next
(
$request
);
}
}
This diff is collapsed.
Click to expand it.
app/app/Http/Middleware/TrustProxies.php
deleted
100644 → 0
+
0
−
35
View file @
adf63136
<?php
namespace
App\Http\Middleware
;
use
Illuminate\Http\Middleware\TrustProxies
as
Middleware
;
use
Illuminate\Http\Request
;
class
TrustProxies
extends
Middleware
{
/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected
$proxies
=
[
'10.0.0.0/8'
,
'172.16.0.0/12'
,
'192.168.0.0/16'
,
'144.76.113.134'
,
'144.76.88.77'
,
'167.233.15.225'
,
];
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected
$headers
=
Request
::
HEADER_X_FORWARDED_FOR
|
Request
::
HEADER_X_FORWARDED_HOST
|
Request
::
HEADER_X_FORWARDED_PORT
|
Request
::
HEADER_X_FORWARDED_PROTO
|
Request
::
HEADER_X_FORWARDED_AWS_ELB
;
}
This diff is collapsed.
Click to expand it.
app/bootstrap/app.php
+
8
−
0
View file @
fab282b5
...
...
@@ -17,6 +17,14 @@
)
->
withMiddleware
(
function
(
Middleware
$middleware
)
{
$middleware
->
web
(
remove
:
[
ValidateCsrfToken
::
class
,
StartSession
::
class
,
ShareErrorsFromSession
::
class
,
AddQueuedCookiesToResponse
::
class
]);
$middleware
->
trustProxies
(
at
:
[
'10.0.0.0/8'
,
'172.16.0.0/12'
,
'192.168.0.0/16'
,
'144.76.113.134'
,
'144.76.88.77'
,
'167.233.15.225'
,
]);
})
->
withExceptions
(
function
(
Exceptions
$exceptions
)
{
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment