Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
open-source
MetaGer
Commits
150b2561
Commit
150b2561
authored
4 years ago
by
Davide Aprea
Browse files
Options
Downloads
Patches
Plain Diff
add associator parameter for protective middleware
parent
9a732734
No related branches found
No related tags found
3 merge requests
!1895
Development
,
!1874
Development
,
!1840
Resolve "Fix Assoziator"
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Http/Middleware/BrowserVerification.php
+6
-3
6 additions, 3 deletions
app/Http/Middleware/BrowserVerification.php
app/Http/Middleware/HumanVerification.php
+8
-4
8 additions, 4 deletions
app/Http/Middleware/HumanVerification.php
with
14 additions
and
7 deletions
app/Http/Middleware/BrowserVerification.php
+
6
−
3
View file @
150b2561
...
...
@@ -17,7 +17,7 @@ class BrowserVerification
* @param \Closure $next
* @return mixed
*/
public
function
handle
(
$request
,
Closure
$next
)
public
function
handle
(
$request
,
Closure
$next
,
$isAsso
=
false
)
{
$bvEnabled
=
config
(
"metager.metager.browserverification_enabled"
);
...
...
@@ -42,8 +42,11 @@ class BrowserVerification
}
header
(
'X-Accel-Buffering: no'
);
if
((
$request
->
filled
(
"loadMore"
)
&&
Cache
::
has
(
$request
->
input
(
"loadMore"
)))
||
app
(
'App\Models\Key'
)
->
getStatus
())
{
return
$next
(
$request
);
//use parameter for middleware to skip this when using associator
if
(
!
$isAsso
){
if
((
$request
->
filled
(
"loadMore"
)
&&
Cache
::
has
(
$request
->
input
(
"loadMore"
)))
||
app
(
'App\Models\Key'
)
->
getStatus
())
{
return
$next
(
$request
);
}
}
ini_set
(
'zlib.output_compression'
,
'Off'
);
...
...
This diff is collapsed.
Click to expand it.
app/Http/Middleware/HumanVerification.php
+
8
−
4
View file @
150b2561
...
...
@@ -17,7 +17,7 @@ class HumanVerification
* @param \Closure $next
* @return mixed
*/
public
function
handle
(
$request
,
Closure
$next
)
public
function
handle
(
$request
,
Closure
$next
,
$isAsso
=
false
)
{
if
(
$request
->
filled
(
"loadMore"
)
&&
Cache
::
has
(
$request
->
input
(
"loadMore"
)))
{
return
$next
(
$request
);
...
...
@@ -46,9 +46,13 @@ class HumanVerification
* If someone that uses a bot finds this out we
* might have to change it at some point.
*/
if
(
!
env
(
'BOT_PROTECTION'
,
false
)
||
app
(
'App\Models\Key'
)
->
getStatus
())
{
$update
=
false
;
return
$next
(
$request
);
//use parameter for middleware to skip this when using associator
if
(
!
$isAsso
){
if
(
!
env
(
'BOT_PROTECTION'
,
false
)
||
app
(
'App\Models\Key'
)
->
getStatus
())
{
$update
=
false
;
return
$next
(
$request
);
}
}
# Get all Users of this IP
...
...
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