[patch] Add "Content-Length" http header when cache is used / Use CRLF in http header

Friedrich Beckmann friedrich.beckmann at posteo.de
Sun Jun 22 18:19:43 UTC 2025


Hi,

i have a small patch that adds the „Content-Length“ field when the cache is used. I do this by calculating the body length from the file size. I have the patch on github in the „content-length“ branch. See:

https://github.com/fredowski/cgit

In addition I changed from LF to CRLF in the http header according to RFC2616. See:

https://www.rfc-editor.org/rfc/rfc2616#page-31

I noticed that my Safari browser displays the page as „half complete“ for quite a while. Only after
the connection is closed after timeout from the server, the browser indicates that the page is complete.
With the „Content-Length“ header field, the page is indicated as complete immediately.

Best regards

Friedrich




More information about the CGit mailing list