diff --git a/web/index.php b/web/index.php index 1252f45..7da2f93 100644 --- a/web/index.php +++ b/web/index.php @@ -17,4 +17,15 @@ if ($basePath !== '' && str_starts_with($uriPath, $basePath)) { $path = '/' . trim($uriPath, '/'); $method = request_method(); +// HEAD (z. B. curl -I) muss wie GET beantwortet werden, nur ohne Rumpf. +if ($method === 'HEAD') { + $method = 'GET'; + ob_start(); + register_shutdown_function(static function (): void { + while (ob_get_level() > 0) { + ob_end_clean(); + } + }); +} + page_handle($method, $path);