Browse Source
- added optional fastcgi handler git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1898 152afb58-edef-0310-8abb-c4023f1b3aa9svn/tags/lighttpd-1.4.17

4 changed files with 51 additions and 11 deletions
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/perl |
||||
#use CGI qw/:standard/; |
||||
use CGI::Fast qw(:standard); |
||||
my $cgi = new CGI; |
||||
while (new CGI::Fast) { |
||||
my $request_uri = $ENV{'REQUEST_URI'}; |
||||
print (STDERR "REQUEST_URI: $request_uri\n"); |
||||
if ($request_uri =~ m/^\/dynamic\/200\// ) { |
||||
print header ( -status => 200, |
||||
-type => 'text/plain' ); |
||||
print ("found here\n"); |
||||
} |
||||
elsif ($request_uri =~ m|^/dynamic/302/| ) { |
||||
print header( -status=>302, |
||||
-location => 'http://www.example.org/'); |
||||
} |
||||
elsif ($request_uri =~ m/^\/dynamic\/404\// ) { |
||||
print header ( -status => 404 |
||||
-type => 'text/plain' ); |
||||
print ("Not found here\n"); |
||||
} |
||||
else { |
||||
print header ( -status => 500, |
||||
-type => 'text/plain'); |
||||
print ("huh\n"); |
||||
}; |
||||
}; |
Loading…
Reference in new issue