Skip to content
Snippets Groups Projects
Commit fb56a8a9 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

fixed headers

parent fabe5354
No related branches found
No related tags found
2 merge requests!1985Development,!1983Resolve "Associator not working"
...@@ -24,8 +24,8 @@ class Assoziator extends Controller ...@@ -24,8 +24,8 @@ class Assoziator extends Controller
$url = route("resultpage", $params); $url = route("resultpage", $params);
# Special Case for local development as the port forwarding does not work within docker # Special Case for local development as the port forwarding does not work within docker
if(\App::environment() === "local" && stripos($url, "http://localhost:8080") === 0){ if (\App::environment() === "local" && stripos($url, "http://localhost:8080") === 0) {
$url = str_replace("http://localhost:8080", "http://nginx", $url); $url = str_replace("http://localhost:8080", config("app.url"), $url);
} }
$ch = curl_init(); $ch = curl_init();
...@@ -40,14 +40,14 @@ class Assoziator extends Controller ...@@ -40,14 +40,14 @@ class Assoziator extends Controller
CURLOPT_LOW_SPEED_TIME => 5, CURLOPT_LOW_SPEED_TIME => 5,
CURLOPT_TIMEOUT => 10, CURLOPT_TIMEOUT => 10,
CURLOPT_URL => $url, CURLOPT_URL => $url,
CURLOPT_HTTPHEADER, array( CURLOPT_HTTPHEADER => array(
"X_FORWARDED_FOR: " . $request->ip(), "X_FORWARDED_FOR: " . $request->ip(),
), ),
)); ));
$response = curl_exec($ch); $response = curl_exec($ch);
if(curl_errno($ch)){ if (curl_errno($ch)) {
abort(500, curl_error($ch)); abort(500, curl_error($ch));
} }
...@@ -55,6 +55,7 @@ class Assoziator extends Controller ...@@ -55,6 +55,7 @@ class Assoziator extends Controller
curl_close($ch); curl_close($ch);
if ($responseCode !== 200) { if ($responseCode !== 200) {
dd($response);
abort(500, "Server currently not available"); abort(500, "Server currently not available");
} }
...@@ -87,7 +88,6 @@ class Assoziator extends Controller ...@@ -87,7 +88,6 @@ class Assoziator extends Controller
$words[$word] = 1; $words[$word] = 1;
} }
} }
} }
arsort($words); arsort($words);
...@@ -135,6 +135,5 @@ class Assoziator extends Controller ...@@ -135,6 +135,5 @@ class Assoziator extends Controller
->with('wordCount', $wordCount) ->with('wordCount', $wordCount)
->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')]);;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment