Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Test the clamp on the page offset
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0204-limits.sh | 10 |
1 file changed, 10 insertions, 0 deletions
diff --git a/tests/t0204-limits.sh b/tests/t0204-limits.sh index fc61b5c..dd9ce68 100755 --- a/tests/t0204-limits.sh +++ b/tests/t0204-limits.sh @@ -290,4 +290,14 @@ test_expect_success 'the context a request asks for is clamped' ' test_grep "<option value=.3. selected>3<" tmp ' +# An offset is held between -1, which the stats page sends for every author, +# and 100000, so a crafted one cannot send the log on a walk over the whole +# history. Below the floor the index still starts from its first row. +test_expect_success 'the offset a request asks for is clamped' ' + cgit_ok limitrc "url=limits/log/&ofs=999999999" >tmp && + test_grep "<a href=./limits/log/?ofs=99950.>\[prev\]</a>" tmp && + cgit_ok limitrc "ofs=-100" >tmp && + test_grep "<a href=./limits/.>limits</a>" tmp +' + test_done |
