aboutsummaryrefslogtreecommitdiff
path: root/ui-clone.c
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'ui-clone.c')
-rw-r--r--ui-clone.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ui-clone.c b/ui-clone.c
index 81e7a4e..3a037ad 100644
--- a/ui-clone.c
+++ b/ui-clone.c
@@ -48,18 +48,20 @@ static void print_pack_info(struct cgit_context *ctx)
static void send_file(struct cgit_context *ctx, char *path)
{
struct stat st;
+ int err;
if (stat(path, &st)) {
switch (errno) {
case ENOENT:
- html_status(404, "Not found", 0);
+ err = 404;
break;
case EACCES:
- html_status(403, "Forbidden", 0);
+ err = 403;
break;
default:
- html_status(400, "Bad request", 0);
+ err = 400;
}
+ html_status(err, 0);
return;
}
ctx->page.mimetype = "application/octet-stream";
@@ -84,7 +86,7 @@ void cgit_clone_info(struct cgit_context *ctx)
void cgit_clone_objects(struct cgit_context *ctx)
{
if (!ctx->qry.path) {
- html_status(400, "Bad request", 0);
+ html_status(400, 0);
return;
}