cgit cache wrong content response http ./. https

Daniel Lange DLange at
Tue Nov 27 16:34:01 CET 2018


cgit bases the cache slot to use solely on ctx.qry.raw:

	err = cache_process(ctx.cfg.cache_size, ctx.cfg.cache_root,
		ctx.qry.raw, ttl, process_request);

Thus running cgit on a website with http:// _and_ https:// results in
the wrong schema being returned if the cache content from the "other
protocol" is not yet expired and the content contains cgit generated URLs.
This is the case for the atom feeds and for the repository home pages
where the "Atom feed" URL of the repository commits is contained.

The cache key used to select the slot should include the protocol (at
least for these pages) to prevent returning the wrong content.

Kind regards,

More information about the CGit mailing list