From c3108847090ed1e7a71a674b55320d86a9a4117d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 16:17:25 -1000 Subject: Test the dumb transport allowlist in one table The allowlist was tested in two places, and the 404 alone did not show the transport was live behind the auth filter, since a page that does not exist answers the same. A loose object and HEAD now have to come through, and the planted alternates file is removed even when the test fails, where it used to leave rob borrowing foo's objects. --- tests/t0303-robustness.sh | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'tests/t0303-robustness.sh') diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index bb405f1..7e79b87 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -633,23 +633,6 @@ test_expect_success 'the dumb transport sends a file with its size' ' cmp body repos/rob/.git/objects/pack/$pack ' -# The alternates file lists object directories by their path on the server, -# which a client fetching over http cannot use and should not learn. -test_expect_success 'the dumb transport withholds the alternates file' ' - mkdir -p repos/rob/.git/objects/info && - echo "$PWD/repos/foo/.git/objects" >repos/rob/.git/objects/info/alternates && - for path in info/alternates info//alternates info/./alternates ./info/alternates \ - info/Alternates /info/alternates - do - cgit_rc robrc "url=rob/objects/$path" >tmp && - grep "^Status: 404" tmp && - ! grep "repos/foo" tmp || return 1 - done && - rm repos/rob/.git/objects/info/alternates && - cgit_rc robrc "url=rob/objects/info/packs" >tmp && - grep "^Status: 200" tmp -' - # A reftable repository keeps only a placeholder in its HEAD file, so the # branch a client is to check out has to come from the refs instead. test_expect_success 'the dumb transport answers HEAD from the refs' ' -- cgit 2.12.1