diff --git a/mongoose.c b/mongoose.c
index d7b1240d794f012e0c9d6a4b84fee3d226455517..a8914595027a98f1e7c754d749cfda7baf953e71 100644
--- a/mongoose.c
+++ b/mongoose.c
@@ -4744,6 +4744,9 @@ static void process_new_connection(struct mg_connection *conn) {
 
   keep_alive_enabled = !strcmp(conn->ctx->config[ENABLE_KEEP_ALIVE], "yes");
 
+  // Important: on new connection, reset the receiving buffer. Credit goes
+  // to crule42.
+  conn->data_len = 0;
   do {
     reset_per_request_attributes(conn);
     conn->request_len = read_request(NULL, conn, conn->buf, conn->buf_size,