From 784ce4aba84503f9a798dd0531b50275f25898c2 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Tue, 18 Aug 2026 20:43:07 -0700 Subject: Always send the Status header --- source/ui-shared.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/ui-shared.c b/source/ui-shared.c index 110dd91..db441e0 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1089,8 +1089,12 @@ void cgit_print_http_headers(void) if (ctx.env.no_http && !strcmp(ctx.env.no_http, "1")) return; + // CGI treats a missing Status as 200, but writing it keeps every + // response's header block the same shape. if (ctx.page.status) htmlf("Status: %d %s\n", ctx.page.status, ctx.page.statusmsg); + else + html("Status: 200 OK\n"); if (ctx.page.mimetype && ctx.page.charset) htmlf("Content-Type: %s; charset=%s\n", ctx.page.mimetype, ctx.page.charset); -- cgit v2.8.0