diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'source/ui-blame.c')
| -rw-r--r-- | source/ui-blame.c | 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 2 insertions, 3 deletions
diff --git a/source/ui-blame.c b/source/ui-blame.c index 9395098..f3d58c0 100644 --- a/source/ui-blame.c +++ b/source/ui-blame.c @@ -274,9 +274,8 @@ static void print_blame_page(const struct object_id *oid, const char *path, cgit_print_error_page(404, "Not Found", "Bad object id: %s", oid_to_hex(oid)); return; } - if (ctx.cfg.max_blob_size && size / 1024 > (unsigned long)ctx.cfg.max_blob_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); + if (cgit_blob_too_large(size)) { + cgit_print_blob_too_large(size); return; } |
