AgeCommit message (Collapse)AuthorLines
Add filename* for a download name past ASCIIBryce Kwon-0/+14
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.
Move the snapshot name tests to the snapshot testsBryce Kwon-0/+29
They take a plain tar, which needs no compressor on the machine.
Test serving a snapshot signatureBryce Kwon-23/+61
No test fetched a signature within the size limit, so the status, the headers that keep a browser from sniffing it and the body went unchecked, as did the answer for a ref with none and the plain tar signature a compressed tar falls back to.
Request every snapshot name back to its refBryce Kwon-69/+197
The names on the links were checked but never requested back, and the tests shared one repository whose refs each test added to, so a run of a subset broke them. On a case-insensitive filesystem a loose V1.0 also answered lookups for v1.0, so the case tests checked different tags from one filesystem to another. The slash ref sat at master's tip, where the commit compare could not tell it from the default branch.
Compare each snapshot format with git archiveBryce Kwon-58/+47
Only the entry count and one file were checked, never the archive itself. git's own writer at the same commit gives the same bytes, so each format is held to it, which also proves the commit served. That leaves unzip -t unused, which busybox may not have.
Link snapshots of a slash ref by a dashed nameBryce Kwon-0/+19
The snapshot page refuses to work a revision out of a name holding a slash, since that name becomes the top directory of the archive, so every link for a ref like release/2.0 answered 404. The ref now goes in the link as the id, and the archive unpacks into the repository's own prefix, as any snapshot asked for by id does.
Add the shared config writers and cgit_rcBryce Kwon-25/+13
The helpers are named by kind. cgitrc_repo and cgitrc_copy write the config file named first, and cgit_url, cgit_query and cgit_rc run cgit, each named after what it is handed first. A repository copies its defaults from the globals read before its repo.url, so cgitrc_repo places every setting itself, and a global can no longer land where it silently stops applying. The t00xx and t01xx files move to them here.
Write the snapshot header and content checks onceBryce Kwon-21/+19
Leave snapshot and feed tool checks to test-libBryce Kwon-16/+4
A lazy prerequisite is checked only when a test asks for it, and test-lib names the missing one on every skipped test, so the skip notes go too. test-lib already defines UNZIP and the unzip it checks. The test that unpacks a tag's tar.gz with gzip now asks for GZIP like every other one that does.
Cut test comments restating the code beside themBryce Kwon-3/+1
Correct the test comments that went staleBryce Kwon-4/+5
Trim a snapshot name without reading out of boundsBryce Kwon-0/+30
For a url of .git, or an empty one, repo_basename stepped its index to the byte before its buffer, read it, and would have cleared it had it held a slash. Git's strbuf trims take the same steps safely, and they lift the 1024-byte cap that failed the page for a longer url.
Keep each snapshot link in one pieceBryce Kwon-0/+22
On a narrow screen the download column broke a snapshot name at a hyphen or left its signature link alone on the next line.
Hold a signature download to max-blob-sizeBryce Kwon-0/+12
A signature is a note a pusher stored, and the download read it whole without the size check every other blob a page inflates goes through.
Lead a snapshot name to its tag ahead of a branchBryce Kwon-0/+9
The refs listing offers a tag's snapshot under the stem of its name, and the lookup back from that name settled on whatever ref matched first, so a branch spelled like the stem was archived in the tag's place.
Find a compressor on the default path when unsetBryce Kwon-0/+14
With no PATH in the environment, the check that a compressor exists gave up and refused every compressed snapshot, though execvp would have found it on the system's default path.
Keep snapshot members from starting at a slashBryce Kwon-0/+21
A name that was all suffix, such as .tar, settled on a ref called v with an empty prefix, and an empty snapshot-prefix did the same for a snapshot asked for by id, so every member of the archive started at /.
Send a charset only with a text typeBryce Kwon-3/+3
Archives, packs and the HEAD file went out as octet-stream or gzip with a UTF-8 charset on the end, since only the plain and about pages cleared it.
Test the hardening passBryce Kwon-2/+2
Settle the snapshot v-prefix from the tag listBryce Kwon-0/+34
compose_snapshot_prefix dropped the leading v of a tag only when just one of the names 1.2, v1.2 and V1.2 resolved as a tag, so that the shorter snapshot name could always be traced back to one tag. Those probes went through ref lookups, and on a case-insensitive filesystem a lookup for V1.2 finds the loose file of v1.2, so every freshly made tag counted as ambiguous and kept its v. Once git packed the refs the lookups became exact and the same tag quietly changed its snapshot names. The claimants on a stripped name are now counted over the tag list itself with exact string comparison, so the answer no longer depends on how a ref is stored or on the filesystem underneath. Two tags that really differ only by the letter's case still both keep it.
Trim the comments and dead code across the treeBryce Kwon-8/+5
Use registered snapshot MIME typesBryce Kwon-3/+3
Rewrite the snapshot test around one helperBryce Kwon-191/+82
Renumber the test scripts into themed rangesBryce Kwon-0/+0
The numbering walks outward from the ground the suite stands on. - t000x for the git version, html validity and the cache - t01xx for page content, one script per page - t02xx for filters, submodule links, dates and limits, which cut across pages - t03xx for defence, the security regressions and the $HOME promise - t04xx for the helper tools under tools/