Fix duplicate connection keep-alive/transfer-encoding headers (#960)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2326 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.21
Stefan Bühler 15 years ago
parent c6c2bf8308
commit 4db2292d50

@ -16,6 +16,7 @@ NEWS
* Trust pcre-config, do not check for pcre manually (#1769)
* Fix fastcgi authorization in subdirectories with check-local=disabled; don't split pathinfo for authorizer. (#963)
* Add possibility to disable methods in mod_compress (#1773)
* Fix duplicate connection keep-alive/transfer-encoding headers (#960)
- 1.4.20 - 2008-09-30

@ -44,16 +44,15 @@ int http_response_write_header(server *srv, connection *con) {
buffer_append_string(b, get_http_status_name(con->http_status));
if (con->request.http_version != HTTP_VERSION_1_1 || con->keep_alive == 0) {
buffer_append_string_len(b, CONST_STR_LEN("\r\nConnection: "));
if (con->keep_alive) {
buffer_append_string_len(b, CONST_STR_LEN("keep-alive"));
response_header_overwrite(srv, con, CONST_STR_LEN("Connection"), CONST_STR_LEN("keep-alive"));
} else {
buffer_append_string_len(b, CONST_STR_LEN("close"));
response_header_overwrite(srv, con, CONST_STR_LEN("Connection"), CONST_STR_LEN("close"));
}
}
if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
buffer_append_string_len(b, CONST_STR_LEN("\r\nTransfer-Encoding: chunked"));
response_header_overwrite(srv, con, CONST_STR_LEN("Transfer-Encoding"), CONST_STR_LEN("chunked"));
}

Loading…
Cancel
Save