diff --git a/Proxy.php b/Proxy.php new file mode 100644 index 0000000..62ac37d --- /dev/null +++ b/Proxy.php @@ -0,0 +1,55 @@ += 200 && $httpCode < 300) { + file_put_contents($cacheFile, $response); + } else { + header('HTTP/1.1 500 Internal Server Error'); + header('Content-Type: application/json; charset=utf-8'); + echo json_encode([ + 'error' => 'Konnte Daten nicht von der Cloud laden.', + 'http_status' => $httpCode, + 'curl_error' => $curlError ? $curlError : 'Kein spezifischer cURL-Fehler. Cloud antwortete nicht mit HTTP 200.' + ]); + exit; + } +} + +header('Content-Type: application/json; charset=utf-8'); +echo $response; \ No newline at end of file