nhttpd: disable range handling for cached content

Origin commit data
------------------
Commit: ee1ab08bd4
Author: martii <m4rtii@gmx.de>
Date: 2014-09-23 (Tue, 23 Sep 2014)
This commit is contained in:
martii
2014-09-23 11:45:59 +02:00
committed by vanhofen
parent c85a6c1948
commit 1611d6229c
4 changed files with 20 additions and 16 deletions

View File

@@ -301,7 +301,7 @@ std::string CyhookHandler::BuildHeader(bool cache) {
strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&mod_time));
result += string_printf("Last-Modified: %s\r\n", timeStr);
if (status == HANDLED_SENDFILE) {
if (status == HANDLED_SENDFILE && !cached) {
result += string_printf("Accept-Ranges: bytes\r\n");
result += string_printf("Content-Length: %lld\r\n", RangeEnd - RangeStart + 1);
if (httpStatus == HTTP_PARTIAL_CONTENT)