Commit 150b2561 authored by Davide Aprea's avatar Davide Aprea
Browse files

add associator parameter for protective middleware

parent 9a732734
......@@ -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');
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment