Commit 28dad569 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

humanverification working again

parent 4b9c0f16
...@@ -21,7 +21,12 @@ class Assoziator extends Controller ...@@ -21,7 +21,12 @@ class Assoziator extends Controller
]; ];
$url = "https://metager.de/meta/meta.ger3?" . http_build_query($params, "", "&", PHP_QUERY_RFC3986); $url = route("resultpage", $params);
# Special Case for local development as the port forwarding does not work within docker
if(env("APP_ENV", "") === "local" && stripos($url, "http://localhost:8080") === 0){
$url = str_replace("http://localhost:8080", "http://nginx", $url);
}
$ch = curl_init(); $ch = curl_init();
...@@ -41,6 +46,11 @@ class Assoziator extends Controller ...@@ -41,6 +46,11 @@ class Assoziator extends Controller
)); ));
$response = curl_exec($ch); $response = curl_exec($ch);
if(curl_errno($ch)){
abort(500, curl_error($ch));
}
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch); curl_close($ch);
......
...@@ -17,7 +17,7 @@ class HumanVerification ...@@ -17,7 +17,7 @@ class HumanVerification
* @param \Closure $next * @param \Closure $next
* @return mixed * @return mixed
*/ */
public function handle($request, Closure $next, $isAsso = false) public function handle($request, Closure $next)
{ {
if ($request->filled("loadMore") && Cache::has($request->input("loadMore"))) { if ($request->filled("loadMore") && Cache::has($request->input("loadMore"))) {
return $next($request); return $next($request);
...@@ -48,11 +48,9 @@ class HumanVerification ...@@ -48,11 +48,9 @@ class HumanVerification
*/ */
//use parameter for middleware to skip this when using associator //use parameter for middleware to skip this when using associator
if(!$isAsso){ if (!env('BOT_PROTECTION', false) || app('App\Models\Key')->getStatus()) {
if (!env('BOT_PROTECTION', false) || app('App\Models\Key')->getStatus()) { $update = false;
$update = false; return $next($request);
return $next($request);
}
} }
# Get all Users of this IP # Get all Users of this IP
......
...@@ -42,7 +42,7 @@ Route::group( ...@@ -42,7 +42,7 @@ Route::group(
->with('css', [mix('css/asso/style.css')]) ->with('css', [mix('css/asso/style.css')])
->with('darkcss', [mix('css/asso/dark.css')]); ->with('darkcss', [mix('css/asso/dark.css')]);
}); });
Route::get('asso/meta.ger3', 'Assoziator@asso')->middleware('browserverification:assoresults', 'humanverification:true')->name("assoresults"); Route::get('asso/meta.ger3', 'Assoziator@asso')->middleware('browserverification:assoresults', 'humanverification')->name("assoresults");
Route::get('impressum', function () { Route::get('impressum', function () {
return view('impressum') return view('impressum')
......
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