From 87e67055ae0a8cf150928d63dc3abe32b69c2d82 Mon Sep 17 00:00:00 2001 From: Michael McVady Date: Thu, 5 Jan 2023 13:35:55 -0600 Subject: Don't return 404 on requests with empty DB --- src/clog.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/clog.c') diff --git a/src/clog.c b/src/clog.c index edd9f2a..d4eeb36 100644 --- a/src/clog.c +++ b/src/clog.c @@ -269,9 +269,8 @@ render_posts_query(struct post_request *post_req) { ); } else { // post_req->type == HTML rows = kore_pgsql_ntuples(&sql); - // FIXME: add test for this: - // if (post_req->resource && rows == 0) { - if (rows == 0) { + // TODO: Add test for this; When database is empty, don't return 404 for base request. + if (post_req->resource && rows == 0) { post_req->resp_status = HTTP_STATUS_NOT_FOUND; goto out; } -- cgit v1.2.3