~ubuntu-branches/ubuntu/hardy/lighttpd/hardy

« back to all changes in this revision

Viewing changes to tests/docroot/www/404.pl

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2007-09-05 09:30:15 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070905093015-pm98jekbu9ylcd3w
Tags: 1.4.17-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Update maintainer field in debian/control.
  - Build against libgamin-dev rather than libfam-dev (fixes a warning
    during startup)
  - Make sure that upgrades succeed, even if we can't restart lighttpd.
  - Clean environment in init.d script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
use CGI qw/:standard/;
 
3
my $cgi = new CGI;
 
4
my $request_uri = $ENV{'REQUEST_URI'};
 
5
print (STDERR "REQUEST_URI: $request_uri\n");
 
6
 
 
7
if ($request_uri =~ m/^\/dynamic\/200\// ) {
 
8
  print header ( -status => 200,
 
9
                 -type   => 'text/plain' );
 
10
  print ("found here\n");
 
11
}
 
12
elsif ($request_uri =~ m|^/dynamic/302/| ) {
 
13
  print header( -status=>302,
 
14
                -location => 'http://www.example.org/');
 
15
}
 
16
elsif ($request_uri =~ m/^\/dynamic\/404\// ) {
 
17
  print header ( -status => 404
 
18
                 -type   => 'text/plain' );
 
19
  print ("Not found here\n");
 
20
}
 
21
elsif ($request_uri =~ m/^\/send404\.pl/ ) {
 
22
  print header ( -status => 404
 
23
                 -type   => 'text/plain' );
 
24
  print ("Not found here (send404)\n");
 
25
}
 
26
elsif ($request_uri =~ m/^\/dynamic\/nostatus\// ) {
 
27
  print ("found here\n");
 
28
}
 
29
else {
 
30
  print header ( -status => 500,
 
31
                 -type   => 'text/plain');
 
32
  print ("huh\n");
 
33
};