Changeset 1947

Show
Ignore:
Timestamp:
08/18/2007 11:14:12 AM (13 months ago)
Author:
jan
Message:

fixed handling of duplicate If-Modified-Since to return 304

- don't append the second string to the first, but free it instead

Location:
branches/lighttpd-1.4.x
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/NEWS

    r1946 r1947  
    2020  * fixed possible overflow in unix-socket path checks on BSD (#713) 
    2121  * fixed extra Content-Length header on 1xx, 204 and 304 (#1002) 
     22  * fixed handling of duplicate If-Modified-Since to return 304  
    2223  * removed config-check if passwd files exist (#1188) 
    2324   
  • branches/lighttpd-1.4.x/src/request.c

    r1928 r1947  
    923923                                                                                        ds->value->ptr)) { 
    924924                                                                        /* ignore it if they are the same */ 
     925 
     926                                                                        ds->free((data_unset *)ds); 
     927                                                                        ds = NULL; 
    925928                                                                } else { 
    926929                                                                        con->http_status = 400; 
     
    978981                                                        } 
    979982 
    980                                                         array_insert_unique(con->request.headers, (data_unset *)ds); 
     983                                                        if (ds) array_insert_unique(con->request.headers, (data_unset *)ds); 
    981984                                                } else { 
    982985                                                        /* empty header-fields are not allowed by HTTP-RFC, we just ignore them */ 
  • branches/lighttpd-1.4.x/tests/request.t

    r1946 r1947  
    340340 
    341341$t->{REQUEST}  = ( <<EOF 
    342 GET / HTTP/1.0 
    343 If-Modified-Since: Sun, 1970 Jan 01 00:00:01 GMT 
    344 If-Modified-Since: Sun, 1970 Jan 01 00:00:01 GMT 
    345 EOF 
    346  ); 
    347 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; 
     342GET /index.html HTTP/1.0 
     343If-Modified-Since: Sun, 01 Jan 2100 00:00:02 GMT 
     344If-Modified-Since: Sun, 01 Jan 2100 00:00:02 GMT 
     345EOF 
     346 ); 
     347$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ]; 
    348348ok($tf->handle_http($t) == 0, 'Duplicate If-Mod-Since, with equal timestamps'); 
    349349