Project

General

Profile

Bug #119 ยป lighttpd-_119-v1.patch

Only overwrite the Content-Length header for a non-HEAD request or if we have non-zero-length response body - bdash, 2006-02-22 11:47

View differences:

src/connections.c (working copy)
483 483
		
484 484
		if ((!(con->parsed_response & HTTP_CONTENT_LENGTH)) && 
485 485
		    (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) == 0) {
486
			buffer_copy_off_t(srv->tmp_buf, chunkqueue_length(con->write_queue));
487
		
488
			response_header_overwrite(srv, con, CONST_STR_LEN("Content-Length"), CONST_BUF_LEN(srv->tmp_buf));
486
		  if (con->request.http_method != HTTP_METHOD_HEAD || chunkqueue_length(con->write_queue) > 0) {
487
		    buffer_copy_off_t(srv->tmp_buf, chunkqueue_length(con->write_queue));
488
		    response_header_overwrite(srv, con, CONST_STR_LEN("Content-Length"), CONST_BUF_LEN(srv->tmp_buf));
489
		  }
489 490
		}
490 491
	} else {
491 492
		/* disable keep-alive if size-info for the body is missing */
    (1-1/1)