lighttpd 1.4.x
https://www.lighttpd.net/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
7 years ago
|
#!/usr/bin/env perl
|
||
|
|
||
6 years ago
|
my $request_uri = $ENV{'REQUEST_URI'};
|
||
![]()
15 years ago
|
|
||
![]()
15 years ago
|
if ($request_uri =~ m/^\/dynamic\/200\// ) {
|
||
6 years ago
|
print "Status: 200\n",
|
||
|
"Content-Type: text/plain\n",
|
||
|
"\n",
|
||
|
"found here\n";
|
||
![]()
15 years ago
|
}
|
||
![]()
15 years ago
|
elsif ($request_uri =~ m|^/dynamic/302/| ) {
|
||
6 years ago
|
print "Status: 302\n",
|
||
|
"Location: http://www.example.org/\n",
|
||
|
"\n";
|
||
![]()
15 years ago
|
}
|
||
|
elsif ($request_uri =~ m/^\/dynamic\/404\// ) {
|
||
6 years ago
|
print "Status: 404\n",
|
||
|
"Content-Type: text/plain\n",
|
||
|
"\n",
|
||
|
"Not found here\n";
|
||
![]()
15 years ago
|
}
|
||
![]()
15 years ago
|
elsif ($request_uri =~ m/^\/send404\.pl/ ) {
|
||
6 years ago
|
print "Status: 404\n",
|
||
|
"Content-Type: text/plain\n",
|
||
|
"\n",
|
||
|
"Not found here (send404)\n";
|
||
![]()
15 years ago
|
}
|
||
|
elsif ($request_uri =~ m/^\/dynamic\/nostatus\// ) {
|
||
|
print ("found here\n");
|
||
|
}
|
||
6 years ago
|
elsif ($request_uri =~ m/^\/dynamic\/redirect_status\// ) {
|
||
6 years ago
|
print "Status: $ENV{'REDIRECT_STATUS'}\n",
|
||
|
"Content-Type: text/plain\n",
|
||
|
"\n",
|
||
|
"REDIRECT_STATUS\n";
|
||
7 years ago
|
}
|
||
12 months ago
|
elsif ($ENV{PATH_INFO} eq "/internal-redir" ) {
|
||
|
# (not actually 404 error, but use separate script from cgi.pl for testing)
|
||
|
print "Status: 200\r\n\r\n";
|
||
|
}
|
||
![]()
15 years ago
|
else {
|
||
6 years ago
|
print "Status: 500\n",
|
||
|
"Content-Type: text/plain\n",
|
||
|
"\n",
|
||
|
"huh\n";
|
||
![]()
15 years ago
|
};
|