Checks the admin files and the POST status in the CMS deployment check
Continuous Integration / check (pull_request) Successful in 2m12s
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 9m10s
Continuous Integration / deploy-production (pull_request) Skipped

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 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 11:12:34 +01:00
co-authored by Claude Sonnet 5.5
parent 288b0e3838
commit 1a37dc249e
+30
View File
@@ -191,6 +191,17 @@ else
fi fi
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 # Alleen met --cms: gedrag van de CMS-host zelf
if [ "$cms_mode" -eq 1 ]; then if [ "$cms_mode" -eq 1 ]; then
# Cachebeleid: pagina's no-cache, assets onveranderlijk # Cachebeleid: pagina's no-cache, assets onveranderlijk
@@ -253,6 +264,25 @@ if [ "$cms_mode" -eq 1 ]; then
fetch /admin/ fetch /admin/
if [ "$status" != "200" ]; then fail "/admin/: status $status, verwacht 200"; fi 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 '<html' "$work/body"; then
fail "/admin/assets/bestaat-niet.js: antwoordt met HTML"
fi
fetch /api/v1/System/capabilities fetch /api/v1/System/capabilities
if [ "$status" != "200" ]; then if [ "$status" != "200" ]; then