Changeset 2099
- Timestamp:
- 02/27/2008 06:35:42 PM (5 months ago)
- Files:
-
- branches/lighttpd-1.4.x/NEWS (modified) (1 diff)
- branches/lighttpd-1.4.x/src/connections.c (modified) (1 diff)
- branches/lighttpd-1.4.x/tests/mod-fastcgi.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/lighttpd-1.4.x/NEWS
r2098 r2099 42 42 * do not suppress content on "307 Temporary Redirect" (#1412) 43 43 * fixed Content-Length header if response body gets removed in connections.c (#1412, part 2) 44 * do not generate a "Content-Length: 0" header for HEAD requests, added test too 44 45 45 46 - 1.4.18 - 2007-09-09 branches/lighttpd-1.4.x/src/connections.c
r2098 r2099 546 546 buffer_reset(ds->value); // Headers with empty values are ignored for output 547 547 } 548 } else if (qlen > = 0) {548 } else if (qlen > 0 || con->request.http_method != HTTP_METHOD_HEAD) { 549 549 /* qlen = 0 is important for Redirects (301, ...) as they MAY have 550 550 * a content. Browsers are waiting for a Content otherwise 551 551 */ 552 buffer_copy_off_t(srv->tmp_buf, chunkqueue_length(con->write_queue));552 buffer_copy_off_t(srv->tmp_buf, qlen); 553 553 554 554 response_header_overwrite(srv, con, CONST_STR_LEN("Content-Length"), CONST_BUF_LEN(srv->tmp_buf)); branches/lighttpd-1.4.x/tests/mod-fastcgi.t
r2027 r2099 8 8 9 9 use strict; 10 use Test::More tests => 4 6;10 use Test::More tests => 47; 11 11 use LightyTest; 12 12 … … 224 224 225 225 SKIP: { 226 skip "no php found", 4unless -x "/usr/bin/php-cgi";226 skip "no php found", 5 unless -x "/usr/bin/php-cgi"; 227 227 $tf->{CONFIGFILE} = 'fastcgi-13.conf'; 228 228 ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); … … 234 234 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; 235 235 ok($tf->handle_http($t) == 0, 'FastCGI + local spawning'); 236 237 $t->{REQUEST} = ( <<EOF 238 HEAD /indexfile/index.php HTTP/1.0 239 Host: www.example.org 240 EOF 241 ); 242 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-Content-Length' => '0' } ]; 243 # Of course a valid content-length != 0 would be ok, but we assume for now that such one is not generated. 244 ok($tf->handle_http($t) == 0, 'Check for buggy content length with HEAD'); 236 245 237 246 $t->{REQUEST} = ( <<EOF

