nhttpd: disable range handling for cached content

This commit is contained in:
martii
2014-09-23 11:45:59 +02:00
committed by svenhoefer
parent 7ff097d842
commit ee1ab08bd4
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)