diff --git a/build/src/mongoose.c b/build/src/mongoose.c index 8c49ffbb..bee96cc4 100644 --- a/build/src/mongoose.c +++ b/build/src/mongoose.c @@ -145,6 +145,10 @@ static void send_http_error(struct mg_connection *conn, int status, suggest_connection_header(conn)); conn->num_bytes_sent += mg_printf(conn, "%s", buf); } + + if (status >= 500) { + conn->must_close = 1; + } } // Return 1 if real file has been found, 0 otherwise diff --git a/mongoose.c b/mongoose.c index 6a4a5279..75309237 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4016,6 +4016,10 @@ static void send_http_error(struct mg_connection *conn, int status, suggest_connection_header(conn)); conn->num_bytes_sent += mg_printf(conn, "%s", buf); } + + if (status >= 500) { + conn->must_close = 1; + } } // Return 1 if real file has been found, 0 otherwise