diff --git a/mongoose.c b/mongoose.c index 98398983..228f860a 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1975,6 +1975,7 @@ static void listdir(struct mg_connection *c, struct mg_http_message *hm, n = mg_snprintf(tmp, sizeof(tmp), "%lu", (unsigned long) (c->send.len - off)); if (n > sizeof(tmp)) n = 0; memcpy(c->send.buf + off - 12, tmp, n); // Set content length + c->is_resp = 0; // Mark response end } // Resolve requested file into `path` and return its fs->st() result diff --git a/src/http.c b/src/http.c index b5c87b1b..fd06045e 100644 --- a/src/http.c +++ b/src/http.c @@ -637,6 +637,7 @@ static void listdir(struct mg_connection *c, struct mg_http_message *hm, n = mg_snprintf(tmp, sizeof(tmp), "%lu", (unsigned long) (c->send.len - off)); if (n > sizeof(tmp)) n = 0; memcpy(c->send.buf + off - 12, tmp, n); // Set content length + c->is_resp = 0; // Mark response end } // Resolve requested file into `path` and return its fs->st() result