APR-HTTP-Headers-Compat

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

  module_name          => 'APR::HTTP::Headers::Compat',
  license              => 'perl',
  dist_author          => 'Andy Armstrong <andy@hexten.net>',
  dist_version_from    => 'lib/APR/HTTP/Headers/Compat.pm',
  recursive_test_files => 1,
  requires             => {
    'APR::Pool'     => 0,
    'APR::Table'    => 0,
    'HTTP::Headers' => 0,
    'Storable'      => 0,
    'Test::More'    => 0,
  },
  add_to_cleanup => ['APR-HTTP-Headers-Compat-*'],
);

$builder->create_build_script();

META.yml  view on Meta::CPAN

license: perl
resources:
  bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=APR-HTTP-Headers-Compat
  license: http://dev.perl.org/licenses/
  repository: git://github.com/AndyA/APR--HTTP--Headers--Compat.git
requires:
  APR::Pool: 0
  APR::Table: 0
  HTTP::Headers: 0
  Storable: 0
  Test::More: 0
provides:
  APR::HTTP::Headers::Compat:
    file: lib/APR/HTTP/Headers/Compat.pm
    version: 0.02
  APR::HTTP::Headers::Compat::MagicArray:
    file: lib/APR/HTTP/Headers/Compat/MagicArray.pm
  APR::HTTP::Headers::Compat::MagicHash:
    file: lib/APR/HTTP/Headers/Compat/MagicHash.pm
generated_by: Module::Build version 0.33
meta-spec:

lib/APR/HTTP/Headers/Compat.pm  view on Meta::CPAN


Because the underlying storage for the headers is an C<APR::Table>
attempts to store an object (such as a L<URI> instance) in the table
will not behave as expected.

I haven't benchmarked but it's certain that this implementation will be
substantially slower than C<HTTP::Headers>.

=head1 DEPENDENCIES

L<APR::Pool>, L<APR::Table>, L<HTTP::Headers>, L<Storable>, L<Test::More>

=head1 SEE ALSO

L<FirePHP::Dispatcher>

=head1 INCOMPATIBILITIES

None reported.

=head1 BUGS AND LIMITATIONS

t/00.load.t  view on Meta::CPAN

use Test::More tests => 1;

BEGIN {
  use_ok( 'APR::HTTP::Headers::Compat' );
}

diag(
  "Testing APR::HTTP::Headers::Compat $APR::HTTP::Headers::Compat::VERSION"
);

t/basic.t  view on Meta::CPAN

#!perl

use strict;
use warnings;

use APR::HTTP::Headers::Compat;
use APR::Pool;
use APR::Table;
use Test::More tests => 10;

my $Pool = APR::Pool->new;

{
  my $table = APR::Table::make( $Pool, 1 );
  ok my $h = APR::HTTP::Headers::Compat->new( $table ), 'new';
  $h->header( 'Content-Type', 'text/plain' );
  is_deeply [ tcont( $table ) ], [ 'Content-Type', 'text/plain' ],
   'add';
  $h->push_header( 'Foo' => 1 );

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

#!perl -w

use strict;
use Test::More tests => 4;

use APR::Pool;
use APR::Table;
use APR::HTTP::Headers::Compat;
use HTTP::Headers::ETag;

my $Pool = APR::Pool->new;

sub mk(@) {
  my $table = APR::Table::make( $Pool, 10 );

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

#!perl -w

use strict;

use Test::More tests => 163;
use APR::Pool;
use APR::Table;
use APR::HTTP::Headers::Compat;

my ( $h, $h2 );
sub j { join( "|", @_ ) }

my $Pool = APR::Pool->new;

sub mk(@) {

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

is( $h->date,                    undef );
is( $h->date( time ),            undef );
is( j( $h->header_field_names ), "Date" );
ok( $h->header( "Date" ) =~ /^[A-Z][a-z][a-z], \d\d .* GMT$/ );
{
  my $off = time - $h->date;
  ok( $off == 0 || $off == 1 );
}

if ( $] < 5.006 ) {
  Test::skip( "Can't call variable method", 1 ) for 1 .. 13;
}
else {
  # other date fields
  for my $field (
    qw(expires if_modified_since if_unmodified_since
    last_modified)
   ) {
    eval <<'EOT'; die $@ if $@;
    is($h->$field, undef);
    is($h->$field(time), undef);

t/pod-coverage.t  view on Meta::CPAN

#!perl -T

use Test::More;
eval "use Test::Pod::Coverage 1.04";
plan skip_all =>
 "Test::Pod::Coverage 1.04 required for testing POD coverage"
 if $@;
all_pod_coverage_ok( { private => [ qr{^[A-Z]+$}, qr{^_} ] } );

t/pod.t  view on Meta::CPAN

#!perl -T

use Test::More;
eval "use Test::Pod 1.14";
plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
all_pod_files_ok();



( run in 0.526 second using v1.01-cache-2.11-cpan-4d50c553e7e )