From 1a37dc249e4d9ab43d6692c990a3dfbf3ade08a7 Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Sun, 8 Nov 2026 11:12:34 +0100 Subject: [PATCH] Checks the admin files and the POST status in the CMS deployment check The check now fetches real admin files (index.html, favicon, the css and js from the served index) and an unknown admin file. A POST with an empty body returns 405; without a body the HTTP/1.0 proxy hop answers 400. Co-Authored-By: Claude Sonnet 5.5 --- web/deploy/verify-deployment.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/web/deploy/verify-deployment.sh b/web/deploy/verify-deployment.sh index 74918d9..7849974 100644 --- a/web/deploy/verify-deployment.sh +++ b/web/deploy/verify-deployment.sh @@ -191,6 +191,17 @@ else fi fi +# Een 200 met het verwachte content type voor een bestand van de admin +expect_admin_file() { + local path="$1" type="$2" + fetch "$path" + if [ "$status" != "200" ]; then + fail "$path: status $status, verwacht 200" + elif [[ "$(header Content-Type)" != "$type"* ]]; then + fail "$path: Content-Type '$(header Content-Type)', verwacht $type" + fi +} + # Alleen met --cms: gedrag van de CMS-host zelf if [ "$cms_mode" -eq 1 ]; then # Cachebeleid: pagina's no-cache, assets onveranderlijk @@ -253,6 +264,25 @@ if [ "$cms_mode" -eq 1 ]; then fetch /admin/ if [ "$status" != "200" ]; then fail "/admin/: status $status, verwacht 200"; fi + # De bestanden van de admin zelf, niet alleen de index: zonder die laadt + # de pagina blanco (een catch-all route mag de static files niet afvangen) + admin_css="$(grep -o '/admin/assets/[A-Za-z0-9_.-]*\.css' "$work/body" | head -n 1 || true)" + admin_js="$(grep -o '/admin/assets/[A-Za-z0-9_.-]*\.js' "$work/body" | head -n 1 || true)" + expect_admin_file /admin/index.html "text/html" + expect_admin_file /admin/favicon-theme.png "image/png" + if [ -z "$admin_css" ] || [ -z "$admin_js" ]; then + fail "/admin/: geen css of js in de index gevonden" + else + expect_admin_file "$admin_css" "text/css" + expect_admin_file "$admin_js" "text/javascript" + fi + # Een onbekend bestand onder /admin is een kale 404, geen HTML + fetch /admin/assets/bestaat-niet.js + if [ "$status" != "404" ]; then + fail "/admin/assets/bestaat-niet.js: status $status, verwacht 404" + elif grep -qi '