TWMC: Add white label (Host header) testing
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / lib / Catty.pm
index 17cff7f..f9285d0 100644 (file)
@@ -92,6 +92,15 @@ sub name : Global {
     $c->response->output($html);
 }
 
+sub host : Global {
+    my ($self, $c) = @_;
+
+    my $host = $c->req->header('Host') || "<undef>";
+    my $html = html( $c->config->{name}, "Host: $host" );
+    $c->response->content_type("text/html");
+    $c->response->output($html);
+}
+
 sub html {
     my ( $title, $body ) = @_;
     return qq{