From 1be85369f36458fe9a2f85ca63285367f94e6172 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 06:26:24 -1000 Subject: Share the max-blob-size check and its refusal Five copies of the test and four of the error page had to agree by hand. The new check pins the four refusals, which no test covered. --- tests/t0204-limits.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/t0204-limits.sh b/tests/t0204-limits.sh index 19df797..245c016 100755 --- a/tests/t0204-limits.sh +++ b/tests/t0204-limits.sh @@ -165,6 +165,19 @@ test_expect_success 'a diff of an oversized blob is not inlined' ' ! grep "aaaaaaaa" tmp ' +test_expect_success 'every page showing a blob refuses an oversized one alike' ' + { + echo "enable-blame=1" && + cat blobdiffrc + } >blobpagesrc && + for page in tree plain blob blame + do + CGIT_CONFIG="$PWD/blobpagesrc" QUERY_STRING="url=blobdiff/$page/big.txt" cgit >tmp && + grep "^Status: 413 Content Too Large" tmp && + grep "Blob size (3 KB) exceeds the limit (1 KB)" tmp || return 1 + done +' + # A missing scintillua leaves the shipped filter with nothing to highlight # with, and a filter that failed there would take the whole page down with # it, so it has to hand the source back escaped instead. -- cgit