Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Ask for the two 404 pages with the cache off
Both requests went through the shared page cache, and the clone one
only worked because clone pages are never stored, which is what the
cgitrc_copy comment warns of.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0301-security.sh | 19 |
1 file changed, 9 insertions, 10 deletions
diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh index 4bb187e..9b887d4 100755 --- a/tests/t0301-security.sh +++ b/tests/t0301-security.sh @@ -290,20 +290,19 @@ test_expect_success 'a doubled percent in a module-link renders as one' ' # An unknown page under a repository used to reach the page header with no # head resolved and crash in the branch switcher. test_expect_success 'an unknown page under a repository answers 404 with its header' ' - cgit_url "foo/nonsense/" >tmp && - grep "^Status: 404 Not Found" tmp && - grep "Invalid request" tmp && - grep "<select name=.h. " tmp + cgitrc_copy nocacherc && + cgit_rc nocacherc "url=foo/nonsense/" >tmp && + test_grep "^Status: 404 Not Found" tmp && + test_grep "Invalid request" tmp && + test_grep "<select name=.h. " tmp ' test_expect_success 'a clone endpoint with http clone off answers the same way' ' - { - echo "enable-http-clone=0" && - cat cgitrc - } >noclonerc && + cgitrc_copy noclonerc enable-http-clone=0 && cgit_rc noclonerc "url=foo/info/refs" >tmp && - grep "^Status: 404 Not Found" tmp && - grep "<select name=.h. " tmp + test_grep "^Status: 404 Not Found" tmp && + test_grep "Invalid request" tmp && + test_grep "<select name=.h. " tmp ' # The .gitmodules file is commit-controlled content, so a derived link may |
