From 4037eb6031af31cb797f6d2375f97de077ce4ff7 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 18:15:28 -1000 Subject: Describe root-readme as the site's about page --- tests/t0301-security.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/t0301-security.sh') diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh index ce2b5da..3df2cee 100755 --- a/tests/t0301-security.sh +++ b/tests/t0301-security.sh @@ -115,6 +115,22 @@ test_expect_success 'non-markdown readme keeps its line structure' ' grep "pre class=.plaintext." tmp ' +# root-readme is the site's own file rather than repository content, so it +# goes out as written, on an about page of its own. +test_expect_success 'root-readme without a filter is its own page, as written' ' + echo "site" >root.html && + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "root-readme=$PWD/root.html" + } >secrootrc && + CGIT_CONFIG="$PWD/secrootrc" QUERY_STRING="url=" cgit >tmp && + grep "
  • about" tmp && + ! grep "site" tmp && + CGIT_CONFIG="$PWD/secrootrc" QUERY_STRING="p=about" cgit >tmp && + grep "^site$" tmp +' + # A Content-Security-Policy without unsafe-inline stops an inline onchange # handler from ever running, so the option form submits through a plain # button and its selects carry no handlers at all. -- cgit