From 1be85369f36458fe9a2f85ca63285367f94e6172 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 06:26:24 -1000 Subject: Share the max-blob-size check and its refusal Five copies of the test and four of the error page had to agree by hand. The new check pins the four refusals, which no test covered. --- source/ui-shared.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/ui-shared.c') diff --git a/source/ui-shared.c b/source/ui-shared.c index b793f74..fd9cd20 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1625,6 +1625,12 @@ void cgit_vprint_error_page(int code, const char *msg, const char *fmt, va_list cgit_print_layout_end(); } +void cgit_print_blob_too_large(unsigned long size) +{ + cgit_print_error_page(413, "Content Too Large", "Blob size (%lu KB) exceeds the limit (%d KB)", + size / 1024, ctx.cfg.max_blob_size); +} + void cgit_print_layout_start(void) { cgit_print_http_headers(); -- cgit