Skip to content

Commit

Permalink
Passing PUT content to the event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
cpq committed Apr 14, 2014
1 parent 872b85b commit 606eab7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mongoose.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 606eab7

Please sign in to comment.