<?php
require_once __DIR__ . '/../../api-user-check.php';

$configuration = getConfiguration();

if (
    isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
    isset($configuration->lastModified) &&
    strtotime($configuration->lastModified) <= strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])
) {
    http_response_code(304);    // Not changed
    die;
}

header('Content-Type: application/json');
header('Last-Modified: ' . $configuration->lastModified);

echo json_encode($configuration);
