Changeset 1898

Show
Ignore:
Timestamp:
08/13/2007 11:09:11 AM (14 months ago)
Author:
darix
Message:

- fixed 404 testsuite
- added optional fastcgi handler

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

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/tests/404-handler.conf

    r1894 r1898  
    11debug.log-request-handling   = "enable" 
     2debug.log-response-header   = "enable" 
     3debug.log-request-header   = "enable" 
    24 
    35server.document-root         = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/" 
     
    1517 
    1618server.modules              = ( 
     19                                  "mod_fastcgi", 
    1720                                  "mod_cgi", 
    1821                                "mod_accesslog" ) 
     
    2730cgi.assign = (".pl" => "/usr/bin/perl" ) 
    2831 
     32# fastcgi.server += ( "/404.pl" => 
     33#                    ( "404-handler" => 
     34#                      ( 
     35#                        "socket" => env.SRCDIR + "/tmp/pl-404-fastcgi-1.socket", 
     36#                        "bin-path" => server.document-root + "/404.pl", 
     37#                        "max-procs" => 1, 
     38#                        "check-local" => "disable", 
     39#                        "broken-scriptfilename" => "enable", 
     40#                      ) 
     41#                    ), 
     42#                  ) 
     43 
    2944$HTTP["url"] =~ "^/static/" { 
    3045  server.error-handler-404 = "/404.html" 
    3146} 
    32 else $HTTP["url"] =~ "^/dynamic/200/" { 
     47else $HTTP["url"] =~ "^/dynamic/" { 
    3348  server.error-handler-404 = "/404.pl" 
    3449} 
    35 else $HTTP["url"] =~ "^/dynamic/302/" { 
    36   server.error-handler-404 = "/404.pl" 
    37 } 
    38 else $HTTP["url"] =~ "^/dynamic/404/" { 
    39   server.error-handler-404 = "/404.pl" 
    40 } 
  • branches/lighttpd-1.4.x/tests/core-404-handler.t

    r1894 r1898  
    2424my $t; 
    2525$tf->{CONFIGFILE} = '404-handler.conf'; 
     26 
    2627ok($tf->start_proc == 0, "Starting lighttpd") or die(); 
    2728 
     
    3031EOF 
    3132 ); 
    32 $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => "static not found\n" } ]; 
     33$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "static not found\n" } ]; 
    3334ok($tf->handle_http($t) == 0, '404 handler => static'); 
    3435 
     36# 
     37# 
     38# 
    3539$t->{REQUEST}  = ( <<EOF 
    3640GET /dynamic/200/notfound HTTP/1.0 
     
    4852 
    4953$t->{REQUEST}  = ( <<EOF 
    50 GET /dynamic/200/notfound HTTP/1.0 
     54GET /dynamic/404/notfound HTTP/1.0 
    5155EOF 
    5256 ); 
    5357$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => "Not found here\n" } ]; 
    54 ok($tf->handle_http($t) == 0, '404 handler => dynamic(200)'); 
     58ok($tf->handle_http($t) == 0, '404 handler => dynamic(404)'); 
    5559 
    5660ok($tf->stop_proc == 0, "Stopping lighttpd"); 
  • branches/lighttpd-1.4.x/tests/docroot/www/404.pl

    r1895 r1898  
    99  print ("found here\n"); 
    1010} 
    11 elsif ($request_uri =~ m|^/dynamic/301/| ) { 
     11elsif ($request_uri =~ m|^/dynamic/302/| ) { 
    1212  print header( -status=>302, 
    1313                -location => 'http://www.example.org/');