Changeset 2154
- Timestamp:
- 04/23/2008 07:10:42 PM (3 months ago)
- Files:
-
- branches/lighttpd-1.4.x/NEWS (modified) (1 diff)
- branches/lighttpd-1.4.x/src/connections.c (modified) (3 diffs)
- branches/lighttpd-1.4.x/tests/request.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/lighttpd-1.4.x/NEWS
r2153 r2154 20 20 * Overwrite Content-Type header in mod_dirlisting instead of inserting (#1614), patch by Henrik Holst 21 21 * Handle EINTR in mod_cgi during write() (#1640) 22 * Allow all http status codes by default; disable body only for 204,205 and 304; generate error pages for 4xx and 5xx (#1639) 22 23 23 24 - 1.4.19 - 2008-03-10 branches/lighttpd-1.4.x/src/connections.c
r2151 r2154 429 429 430 430 switch(con->http_status) { 431 case 400: /* class: header + custom body */ 432 case 401: 433 case 403: 434 case 404: 435 case 408: 436 case 409: 437 case 411: 438 case 416: 439 case 423: 440 case 500: 441 case 501: 442 case 503: 443 case 505: 431 case 204: /* class: header only */ 432 case 205: 433 case 304: 434 /* disable chunked encoding again as we have no body */ 435 con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED; 436 con->parsed_response &= ~HTTP_CONTENT_LENGTH; 437 chunkqueue_reset(con->write_queue); 438 439 con->file_finished = 1; 440 break; 441 default: /* class: header + body */ 444 442 if (con->mode != DIRECT) break; 443 444 /* only custom body for 4xx and 5xx */ 445 if (con->http_status < 400 || con->http_status >= 600) break; 445 446 446 447 con->file_finished = 0; … … 453 454 454 455 buffer_copy_string_buffer(con->physical.path, con->conf.errorfile_prefix); 455 buffer_append_string(con->physical.path, get_http_status_body_name(con->http_status)); 456 buffer_append_long(con->physical.path, con->http_status); 457 buffer_append_string_len(con->physical.path, CONST_STR_LEN(".html")); 456 458 457 459 if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) { … … 499 501 response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html")); 500 502 } 501 /* fall through */502 case 207:503 case 200: /* class: header + body */504 case 201:505 case 300:506 case 301:507 case 302:508 case 303:509 case 307:510 break;511 512 case 206: /* write_queue is already prepared */513 break;514 case 204:515 case 205: /* class: header only */516 case 304:517 default:518 /* disable chunked encoding again as we have no body */519 con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED;520 con->parsed_response &= ~HTTP_CONTENT_LENGTH;521 chunkqueue_reset(con->write_queue);522 523 con->file_finished = 1;524 503 break; 525 504 } branches/lighttpd-1.4.x/tests/request.t
r2027 r2154 102 102 EOF 103 103 ); 104 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 417 , '-HTTP-Content' => ''} ];104 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 417 } ]; 105 105 ok($tf->handle_http($t) == 0, 'Continue, Expect'); 106 106

