APR-HTTP-Headers-Compat

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for APR-HTTP-Headers-Compat

0.01    2009-06-11
        - Initial release.

0.02    2009-06-12
        - Expanded on documentation
        - Removed a couple of errant $DB::single = 1 statements. Mad
          debugging skilz.

t/compat/base/headers.t  view on Meta::CPAN


is( $h->server,                 undef );
is( $h->server( "Apache/2.1" ), undef );
is( $h->server,                 "Apache/2.1" );

is( $h->from( "Gisle\@ActiveState.com" ), undef );
ok( $h->header( "from", "Gisle\@ActiveState.com" ) );

is( $h->referer( "http://www.example.com" ), undef );
is( $h->referer,                             "http://www.example.com" );
is( $h->referrer,                            "http://www.example.com" );
is( $h->referer( "http://www.example.com/#bar" ),
  "http://www.example.com" );
is( $h->referer, "http://www.example.com/" );

SKIP: {
  skip "Can't store references" => 4;
  require URI;
  my $u = URI->new( "http://www.example.com#bar" );
  $h->referer( $u );
  is( $u->as_string,           "http://www.example.com#bar" );
  is( $h->referer->fragment,   undef );
  is( $h->referrer->as_string, "http://www.example.com" );
  is( $h->as_string,           <<EOT);
From: Gisle\@ActiveState.com
Referer: http://www.example.com
User-Agent: Mozilla/1.2
Server: Apache/2.1
Content-Encoding: gzip
Content-Language: no
Content-Type: text/html;
 charSet = "ISO-8859-1"; Foo=1
Title: This is a test



( run in 1.103 second using v1.01-cache-2.11-cpan-49f99fa48dc )