Changeset 487

Show
Ignore:
Timestamp:
07/31/2005 10:15:15 AM (3 years ago)
Author:
jan
Message:

Content-Length only works if Transfer-Encoding is not set

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.3.x/src/response.c

    r482 r487  
    152152        if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) { 
    153153                BUFFER_APPEND_STRING_CONST(b, "\r\nTransfer-Encoding: chunked"); 
     154        } else if (file_size >= 0 && con->http_status != 304) { 
     155                BUFFER_APPEND_STRING_CONST(b, "\r\nContent-Length: "); 
     156                buffer_append_off_t(b, file_size); 
    154157        } 
    155158         
     
    207210                BUFFER_APPEND_STRING_CONST(b, "\r\nLast-Modified: "); 
    208211                buffer_append_string_buffer(b, srv->mtime_cache[i].str); 
    209         } 
    210          
    211         if (file_size >= 0 && con->http_status != 304) { 
    212                 BUFFER_APPEND_STRING_CONST(b, "\r\nContent-Length: "); 
    213                 buffer_append_off_t(b, file_size); 
    214212        } 
    215213