AgeCommit message (Collapse)AuthorLines
Move the mimetype file tests to the plain testsBryce Kwon-0/+23
Each now writes a types file and config of its own rather than rewriting the one the test before it left.
Test the blob page by object idBryce Kwon-1/+29
Only a robustness test touched the blob page, so a request by bare id, the binary type, the untrusted headers and the refusal of a malformed id had no check.
Test plain on a symlink and a submodule entryBryce Kwon-0/+24
Test the PDF exception to the unsafe plain typesBryce Kwon-0/+18
Test the untrusted headers on a plain fileBryce Kwon-0/+16
The content security policy had no test anywhere, and nosniff was only checked on a scanned repository.
Test a plain listing below the rootBryce Kwon-0/+23
Hold the plain tests to a working pageBryce Kwon-16/+12
The plain requests passed on any answer short of a crash, and the listing test never looked at where its links led. The types config was a copy of the shared one with its page cache still on, which cgitrc_copy exists to switch off.
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 plain and about pages cleared it.
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