From mboxrd@z Thu Jan 1 00:00:00 1970 From: asjo at koldfront.dk (Adam =?iso-8859-1?Q?Sj=F8gren?=) Date: Fri, 01 Feb 2013 18:48:21 +0100 Subject: Return "404 Not found" if a repo doesn't exist (any more). References: <87sj7pa0t2.fsf@topper.koldfront.dk> Message-ID: <87obg4ylga.fsf@topper.koldfront.dk> On Fri, 1 Feb 2013 12:58:25 +0100, Jason wrote: > On Sat, Dec 1, 2012 at 11:02 PM, Adam Sj?gren wrote: >> @@ -247,6 +247,17 @@ void cgit_print_repolist() >> + for (i=0; i> + if (!(is_match(&cgit_repolist.repos[i]) && is_in_url(&cgit_repolist.repos[i]))) >> + continue; >> + hits++; >> + } >> + if (!hits) { >> + ctx.page.status = 404; > I like the idea of this, but I hate to duplicate the loop logic like that. Yeah, that is ugly. > But in fact we do need to know whether there are any hits before > sending headers. That's how far I got... > Tricky. I'll see if I can refactor things to be a bit nicer. Sounds great! Best regards, Adam -- "Ge mig en vinterdrog, ge mig allt du har Adam Sj?gren Kom nu jag ?r kroniskt l?g, bara m?rkret h?rs" asjo at koldfront.dk