Perfect response error hints

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
main
Jianhui Zhao 2017-12-30 11:05:31 +08:00
parent 34bbc9264f
commit 278f7a19dd
1 changed files with 1 additions and 1 deletions

View File

@ -330,7 +330,7 @@ static void client_parse_header(struct uh_client *cl, char *data)
if (!strcmp(data, "content-length")) { if (!strcmp(data, "content-length")) {
r->content_length = strtoul(val, &err, 0); r->content_length = strtoul(val, &err, 0);
if (err && *err) { if (err && *err) {
cl->send_error(cl, 400, "Bad Request", NULL); cl->send_error(cl, 400, "Bad Request", "Invalid Content-Length");
return; return;
} }
} else if (!strcmp(data, "transfer-encoding") && !strcmp(val, "chunked")) { } else if (!strcmp(data, "transfer-encoding") && !strcmp(val, "chunked")) {