@@ -7183,14 +7183,6 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
7183
7183
: StatusCode::PartialContent_206;
7184
7184
}
7185
7185
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
-
7194
7186
// Serve file content by using a content provider
7195
7187
if (!res.file_content_path_ .empty ()) {
7196
7188
const auto &path = res.file_content_path_ ;
@@ -7217,6 +7209,14 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
7217
7209
});
7218
7210
}
7219
7211
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
+
7220
7220
return write_response_with_content (strm, close_connection, req, res);
7221
7221
} else {
7222
7222
if (res.status == -1 ) { res.status = StatusCode::NotFound_404; }
0 commit comments