Fix handling of partial range request (fixes issue #2873)

This commit is contained in:
Jengerer
2020-04-20 13:19:42 -04:00
committed by Marshall Greenblatt
parent 27257d0288
commit 87a7c4f94b
4 changed files with 61 additions and 11 deletions

View File

@@ -107,8 +107,9 @@ scoped_refptr<net::HttpResponseHeaders> MakeResponseHeaders(
// Track the headers that have already been set. Perform all comparisons in
// lowercase.
std::set<std::string> set_headers_lowercase;
if (status_code == net::HTTP_OK) {
if ((status_code >= 200 && status_code < 300) &&
status_code != net::HTTP_NO_CONTENT &&
status_code != net::HTTP_RESET_CONTENT) {
if (!mime_type.empty()) {
headers->AddHeader(MakeHeader(net::HttpRequestHeaders::kContentType,
MakeContentTypeValue(mime_type, charset)));