@@ -7183,14 +7183,6 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
71837183 : StatusCode::PartialContent_206;
71847184 }
71857185
7186- if (detail::range_error (req, res)) {
7187- res.body .clear ();
7188- res.content_length_ = 0 ;
7189- res.content_provider_ = nullptr ;
7190- res.status = StatusCode::RangeNotSatisfiable_416;
7191- return write_response (strm, close_connection, req, res);
7192- }
7193-
71947186 // Serve file content by using a content provider
71957187 if (!res.file_content_path_ .empty ()) {
71967188 const auto &path = res.file_content_path_ ;
@@ -7217,6 +7209,14 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
72177209 });
72187210 }
72197211
7212+ if (detail::range_error (req, res)) {
7213+ res.body .clear ();
7214+ res.content_length_ = 0 ;
7215+ res.content_provider_ = nullptr ;
7216+ res.status = StatusCode::RangeNotSatisfiable_416;
7217+ return write_response (strm, close_connection, req, res);
7218+ }
7219+
72207220 return write_response_with_content (strm, close_connection, req, res);
72217221 } else {
72227222 if (res.status == -1 ) { res.status = StatusCode::NotFound_404; }
0 commit comments