aboutsummaryrefslogtreecommitdiff
path: root/src/clog.c
diff options
context:
space:
mode:
authorMichael McVady <femtonaut@gmail.com>2023-01-05 13:35:55 -0600
committerMichael McVady <femtonaut@gmail.com>2023-01-05 13:35:55 -0600
commit87e67055ae0a8cf150928d63dc3abe32b69c2d82 (patch)
treea6e861bf3b3004f89596aee89eb3b3f38e1a3c98 /src/clog.c
parentc3dd646429103ab5a5e77da524715ad3ace4c987 (diff)
Don't return 404 on requests with empty DB
Diffstat (limited to 'src/clog.c')
-rw-r--r--src/clog.c5
1 files changed, 2 insertions, 3 deletions
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;
}