yellow ? $this->yellow->system : null;
}
private function sendResponse($message, $statusCode = 200) {
if (!headers_sent()) {
header("HTTP/1.1 $statusCode");
header("Content-Type: text/html; charset=UTF-8");
}
// Basis-URL aus der aktuellen Anfrage bestimmen
$fullUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http")
. "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
// Trigger-Pfad aus der Yellow-Konfiguration holen
$triggerPath = $this->yellow->system->get("mastodonapiTriggerPath");
// Ziel-URL: Alles vor dem Trigger-Pfad abschneiden
$redirectUrl = str_replace($triggerPath, "/", $fullUrl);
echo "";
echo "";
echo "Mastodon/GoToSocial API";
echo "" . htmlspecialchars($message) . "
";
echo "You will be redirected in 5 seconds...
";
echo "";
exit;
}
}