| 1 | package POE::Component::Server::HTTPServer::NotFoundHandler; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use HTTP::Status; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use POE::Component::Server::HTTPServer::Handler qw( H_CONT H_FINAL ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use base 'POE::Component::Server::HTTPServer::Handler'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | our $Instance; | |||||||||
| 8 | |||||||||||
| 9 | 3 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 10 | 3 | my $class = shift; | |||||||||
| 11 | 3 | ▶ | $Instance = bless {}, $class | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | unless defined($Instance); | ||||||||||
| 13 | 3 | return $Instance; | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 6 | ▶ | sub handle { | ||||||||
|
Subroutine
handle: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 17 | 6 | my $self = shift; | |||||||||
| 18 | 6 | my $context = shift; | |||||||||
| 19 | 6 | $context->{response}->code( RC_NOT_FOUND ); | |||||||||
| 20 | 6 | my $message = ""; | |||||||||
| 21 | 6 | ▶ | if ( defined($context->{error_message}) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 0 | $message = ":<BR>$context->{error_message}\n"; | |||||||||
| 23 | } | ||||||||||
| 24 | 6 | $context->{response}->content("<HTML><BODY>Not Found$message</BODY></HTML>"); | |||||||||
| 25 | 6 | return H_FINAL; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 2 | 1; | |||||||||
| 29 | __END__ | ||||||||||