don't force a Content-Length header in HEAD requests (#119)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1382 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
parent
636c890721
commit
7a220fceb4
|
@ -522,7 +522,8 @@ static int connection_handle_write_prepare(server *srv, connection *con) {
|
|||
/* we have all the content and chunked encoding is not used, set a content-length */
|
||||
|
||||
if ((!(con->parsed_response & HTTP_CONTENT_LENGTH)) &&
|
||||
(con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) == 0) {
|
||||
(con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) == 0 &&
|
||||
con->request.http_method != HTTP_METHOD_HEAD) { /* don't force a Content-Length if we had a HEAD request */
|
||||
buffer_copy_off_t(srv->tmp_buf, chunkqueue_length(con->write_queue));
|
||||
|
||||
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Length"), CONST_BUF_LEN(srv->tmp_buf));
|
||||
|
|
Loading…
Reference in New Issue