From c92b8cb32d10559791e7bd4937ecc5f49a45ba9d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 3 Jan 2013 00:29:58 +0100 Subject: bail out on unsupported Expect: headers --- client.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 25cc271..8604034 100644 --- a/client.c +++ b/client.c @@ -224,9 +224,15 @@ static void client_parse_header(struct client *cl, char *data) if (isupper(*name)) *name = tolower(*name); - if (!strcasecmp(data, "Expect") && - !strcasecmp(val, "100-continue")) - cl->request.expect_cont = true; + if (!strcasecmp(data, "Expect")) { + if (!strcasecmp(val, "100-continue")) + cl->request.expect_cont = true; + else { + uh_header_error(cl, 400, "Bad Request"); + return; + } + } + blobmsg_add_string(&cl->hdr, data, val); -- cgit v1.2.3