From mboxrd@z Thu Jan 1 00:00:00 1970 From: peter at colberg.org (Peter Colberg) Date: Mon, 7 Dec 2015 14:28:08 -0500 Subject: [PATCH] ui-repolist: return HTTP 404 if no repositories found Message-ID: <1449516489-2091-1-git-send-email-peter@colberg.org> Dear cgit maintainers, With the following patch, cgit returns HTTP 404 Not found when querying a non-existent repository. This is useful to signal to search engines that a repository no longer exists. Further, webservers such as nginx permit logging requests to different files depending on the HTTP code. cgit_print_repolist() does an early return with an error page if no repository is found. I added a helper function is_visible() to avoid repeating the repo conditions (and risking them getting out of sync). Regards, Peter Peter Colberg (1): ui-repolist: return HTTP 404 if no repositories found ui-repolist.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) -- 2.6.2