From 606eab7f4f71bd57d34a6255a73d4eba51ebd95a Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Mon, 14 Apr 2014 16:14:13 +0100 Subject: [PATCH] Passing PUT content to the event handler --- mongoose.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mongoose.c b/mongoose.c index fee10c57e9..cfb6e34f99 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3922,7 +3922,8 @@ static void open_local_endpoint(struct connection *conn, int skip_user) { #if MONGOOSE_POST_SIZE_LIMIT > 1 { const char *cl = mg_get_header(&conn->mg_conn, "Content-Length"); - if (!strcmp(conn->mg_conn.request_method, "POST") && + if ((strcmp(conn->mg_conn.request_method, "POST") == 0 || + strcmp(conn->mg_conn.request_method, "PUT") == 0) && (cl == NULL || to64(cl) > MONGOOSE_POST_SIZE_LIMIT)) { send_http_error(conn, 500, "POST size > %zu", (size_t) MONGOOSE_POST_SIZE_LIMIT);