Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Add filename* for a download name past ASCII
The plain, snapshot and blob pages sent a name such as café.txt raw in
filename, which a client may read as ISO-8859-1. RFC 6266 has such a
name sent again as filename*, percent-encoded in UTF-8, for a client
that knows the form, with filename first for one that does not. The
extended form carries UTF-8 alone, so a name that is not valid UTF-8
keeps the plain filename by itself.
Diffstat (limited to 'tests/t0110-snapshot.sh')
| -rwxr-xr-x | tests/t0110-snapshot.sh | 14 |
1 file changed, 14 insertions, 0 deletions
diff --git a/tests/t0110-snapshot.sh b/tests/t0110-snapshot.sh index ded694d..0ada26d 100755 --- a/tests/t0110-snapshot.sh +++ b/tests/t0110-snapshot.sh @@ -430,4 +430,18 @@ test_expect_success 'a signature past max-blob-size is refused' ' cgit_ok sigrc "url=signed/snapshot/signed-one.tar.gz.asc" >tmp ' +# A tag named in UTF-8 gives a snapshot name past ASCII, which is sent as it +# is in filename and percent-encoded in filename*. +test_expect_success 'a snapshot name in UTF-8 is also sent as filename*' ' + mkrepo repos/accent 1 && + tag=$(printf "caf\303\251") && + git -C repos/accent tag "$tag" && + cgitrc_repo accentrc accent snapshots=tar && + cgit_ok accentrc "url=accent/refs/tags" >tmp && + test_grep "<a href=./accent/snapshot/accent-caf%C3%A9.tar.>accent-$tag.tar</a>" tmp && + cgit_ok accentrc "url=accent/snapshot/accent-caf%C3%A9.tar" >tmp && + sed "/^$/q" tmp >headers && + test_grep "^Content-Disposition: inline; filename=.accent-$tag.tar.; filename\*=UTF-8..accent-caf%C3%A9.tar$" headers +' + test_done |
