[PATCH 01/17] ui-shared: add cgit_print_error_page() function

John Keeping john at keeping.me.uk
Tue Apr 7 20:17:54 CEST 2015


On Tue, Apr 07, 2015 at 03:36:32PM +0200, Jason A. Donenfeld wrote:
> I've put them in this branch with a few fixes:
> http://git.zx2c4.com/cgit/log/?h=jk/http-status-codes
> 
> Feel free to send diffs I should squash into any of these commits.

Thanks.  The only other change I have from testing this yesterday is
this; I'm not sure if 5 minutes is a sensible value here but I'm not
sure it's worth exposing this as a config variable and any downstream
cache can be configured with specific timeouts for different response
codes if required:

-- >8 --
Subject: [PATCH] fixup! ui-shared: add cgit_print_error_page() function

---
 ui-shared.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui-shared.c b/ui-shared.c
index c11d9b6..5126962 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -770,6 +770,7 @@ void cgit_print_docend(void)
 void cgit_print_error_page(int code, const char *msg, const char *fmt, ...)
 {
 	va_list ap;
+	ctx.page.expires = 5 * 60; /* 5 minutes */
 	ctx.page.status = code;
 	ctx.page.statusmsg = msg;
 	cgit_print_http_headers();
-- 8< --


More information about the CGit mailing list