AgeCommit message (Collapse)AuthorLines
Add the shared config writers and cgit_rcBryce Kwon-11/+5
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.
Keep every control byte out of a header valueBryce Kwon-0/+14
A quoted header value escaped only the quote, the backslash, CR and LF. A web server refuses a response whose header holds any other control byte, so a file named with one could not be downloaded at all.
Answer the plain view once for duplicate entriesBryce Kwon-0/+25
A tree can hold two entries of one name when fsck is off, and the walk went on after the first answered: a second file put two responses in one body, and a directory under the same name printed headers from the mimetype string the first had already freed.
Keep the charset off types that only spell xmlBryce Kwon-0/+25
Matching xml anywhere in the type also caught the Office formats, whose names hold openxmlformats, so a .docx went out with a UTF-8 charset.
Send a charset only with a text typeBryce Kwon-2/+2
Archives, packs and the HEAD file went out as octet-stream or gzip with a UTF-8 charset on the end, since only the blob page cleared it. The headers now decide from the type itself, so the two places that cleared the charset by hand no longer need to.
Trim the comments and dead code across the treeBryce Kwon-6/+4
Add tests for the plain page and the atom feedBryce Kwon-0/+51