Changeset 1869
- Timestamp:
- 06/15/2007 02:08:32 PM (16 months ago)
- Location:
- branches/lighttpd-1.4.x
- Files:
-
- 2 modified
-
src/request.c (modified) (5 diffs)
-
tests/core-request.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/lighttpd-1.4.x/src/request.c
r1727 r1869 284 284 285 285 int done = 0; 286 287 data_string *ds = NULL;288 286 289 287 /* … … 716 714 case '\r': 717 715 if (con->parse_request->ptr[i+1] == '\n') { 716 data_string *ds = NULL; 717 718 718 /* End of Headerline */ 719 719 con->parse_request->ptr[i] = '\0'; … … 721 721 722 722 if (in_folding) { 723 if (!ds) { 723 buffer *key_b; 724 /** 725 * we use a evil hack to handle the line-folding 726 * 727 * As array_insert_unique() deletes 'ds' in the case of a duplicate 728 * ds points somewhere and we get a evil crash. As a solution we keep the old 729 * "key" and get the current value from the hash and append us 730 * 731 * */ 732 733 if (!key || !key_len) { 724 734 /* 400 */ 725 735 … … 738 748 return 0; 739 749 } 740 buffer_append_string(ds->value, value); 750 751 key_b = buffer_init(); 752 buffer_copy_string_len(key_b, key, key_len); 753 754 if (NULL != (ds = (data_string *)array_get_element(con->request.headers, key_b->ptr))) { 755 buffer_append_string(ds->value, value); 756 } 757 758 buffer_free(key_b); 741 759 } else { 742 760 int s_len; … … 970 988 is_key = 1; 971 989 value = 0; 972 key_len = 0; 990 #if 0 991 /** 992 * for Bug 1230 keep the key_len a live 993 */ 994 key_len = 0; 995 #endif 973 996 in_folding = 0; 974 997 } else { -
branches/lighttpd-1.4.x/tests/core-request.t
r1374 r1869 9 9 use strict; 10 10 use IO::Socket; 11 use Test::More tests => 3 3;11 use Test::More tests => 36; 12 12 use LightyTest; 13 13 … … 274 274 ok($tf->handle_http($t) == 0, 'uppercase filenames'); 275 275 276 $t->{REQUEST} = ( <<EOF 277 GET / HTTP/1.0 278 Location: foo 279 Location: foobar 280 baz 281 EOF 282 ); 283 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; 284 ok($tf->handle_http($t) == 0, '#1209 - duplicate headers with line-wrapping'); 285 286 $t->{REQUEST} = ( <<EOF 287 GET / HTTP/1.0 288 Location: 289 Location: foobar 290 baz 291 EOF 292 ); 293 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; 294 ok($tf->handle_http($t) == 0, '#1209 - duplicate headers with line-wrapping - test 2'); 295 296 $t->{REQUEST} = ( <<EOF 297 GET / HTTP/1.0 298 A: 299 Location: foobar 300 baz 301 EOF 302 ); 303 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; 304 ok($tf->handle_http($t) == 0, '#1209 - duplicate headers with line-wrapping - test 3'); 305 306 307 276 308 277 309 ok($tf->stop_proc == 0, "Stopping lighttpd");

