diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0105-plain.sh | 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 14 insertions, 0 deletions
diff --git a/tests/t0105-plain.sh b/tests/t0105-plain.sh index 2e5513f..4615dc5 100755 --- a/tests/t0105-plain.sh +++ b/tests/t0105-plain.sh @@ -96,4 +96,18 @@ test_expect_success 'plain answers once for duplicate tree entries' ' grep "^Content-Type: image/png" tmp ' +# A header line cannot carry a control byte, and a web server refuses the +# whole response over one, so a file name holding one is sent with a stand-in. +test_expect_success 'a control character in a file name stays out of the headers' ' + ( + cd repos/dup && + blob=$(printf x | git hash-object -w --stdin) && + top=$(printf "100644 blob %s\\tctl\\001name.txt\\n" $blob | git mktree) && + c=$(echo ctl | git commit-tree $top) && + git update-ref refs/heads/ctl $c + ) && + CGIT_CONFIG="$PWD/duprc" QUERY_STRING="url=dup/plain/ctl%01name.txt&h=ctl" cgit >tmp && + grep "^Content-Disposition: inline; filename=.ctl?name.txt.$" tmp +' + test_done |
