From 242706ea34b3df24804c0adea93ed399167405cd Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 31 Dec 2020 18:14:05 -0500 Subject: [PATCH] Fix #820 --- httplib.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index 9b76290..68a8a58 100644 --- a/httplib.h +++ b/httplib.h @@ -4235,7 +4235,10 @@ inline bool Server::write_response_core(Stream &strm, bool close_connection, bool need_apply_ranges) { assert(res.status != -1); - if (400 <= res.status && error_handler_) { error_handler_(req, res); } + if (400 <= res.status && error_handler_) { + error_handler_(req, res); + need_apply_ranges = true; + } std::string content_type; std::string boundary;