Files
ndw-website/calendar-proxy.php
2026-06-14 12:33:36 +02:00

13 lines
515 B
PHP

<?php
// Proxy for the NDW Nextcloud public calendar — avoids CORS from client JS
$url = 'https://v2202606368123470420.bestsrv.de/remote.php/dav/public-calendars/acfadeb0ffc80a874a310552267cddc1/?export';
$ctx = stream_context_create(['http' => ['timeout' => 5, 'ignore_errors' => true]]);
$data = @file_get_contents($url, false, $ctx);
if ($data === false) {
http_response_code(502);
exit;
}
header('Content-Type: text/calendar; charset=utf-8');
header('Cache-Control: public, max-age=300');
echo $data;