List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] ui-repolist: return HTTP 404 if no repositories found
@ 2015-12-07 19:28 peter
  2015-12-07 19:28 ` peter
  0 siblings, 1 reply; 17+ messages in thread
From: peter @ 2015-12-07 19:28 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-01-14 13:35 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-07 19:28 [PATCH] ui-repolist: return HTTP 404 if no repositories found peter
2015-12-07 19:28 ` peter
2015-12-07 20:28   ` john
2015-12-08 17:53     ` [PATCH v2 0/2] " peter
2015-12-08 17:53       ` [PATCH v2 1/2] ui-repolist: extract repo visibility criteria to separate function peter
2016-01-13 16:15         ` Jason
2015-12-08 17:53       ` [PATCH v2 2/2] ui-repolist: return HTTP 404 if no repositories found peter
2016-01-13 16:21         ` Jason
2016-01-13 22:25           ` peter
2016-01-13 22:25             ` [PATCH 1/2] Compile with -Wstrict-prototypes -Wmissing-prototypes peter
2016-01-13 23:29               ` john
2016-01-14 13:01                 ` Jason
2016-01-14 13:12                   ` mailings
2016-01-14 13:32                   ` john
2016-01-14 13:35                     ` Jason
2016-01-13 22:25             ` [PATCH 2/2] Fix missing prototype declarations peter
2016-01-14 13:02               ` Jason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).