mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 08:28:42 +00:00
Return proper HTTP response when accessing info/
Currently, when a user directly accesses the info command of a repository, we exit cgit without printing anything to stdout, bringing up error messages like "502 Bad Gateway" or "An error occurred while reading CGI reply (no response received)". Instead of bailing out, at least print the HTTP headers, including a reasonable error message. Reported-by: Janus Troelsen Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
This commit is contained in:
parent
c641e0ab64
commit
ed7e3bc822
@ -71,8 +71,10 @@ static void send_file(char *path)
|
|||||||
|
|
||||||
void cgit_clone_info(void)
|
void cgit_clone_info(void)
|
||||||
{
|
{
|
||||||
if (!ctx.qry.path || strcmp(ctx.qry.path, "refs"))
|
if (!ctx.qry.path || strcmp(ctx.qry.path, "refs")) {
|
||||||
|
html_status(400, "Bad request", 0);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ctx.page.mimetype = "text/plain";
|
ctx.page.mimetype = "text/plain";
|
||||||
ctx.page.filename = "info/refs";
|
ctx.page.filename = "info/refs";
|
||||||
|
Loading…
Reference in New Issue
Block a user