Amazon-CloudFront-Thin

 view release on metacpan or  search on metacpan

lib/Amazon/CloudFront/Thin.pm  view on Meta::CPAN

        if (index($path, ']]>') >= 0) {
            $path =~ s/\]\]>/\]\]\]\]><![CDATA[>/gs; # split CDATA end token.
        }
        $path_content .= '<Path><![CDATA[' . $path . ']]></Path>'
    }
    return qq{<?xml version="1.0" encoding="UTF-8"?><InvalidationBatch xmlns="http://cloudfront.amazonaws.com/doc/2018-11-05/"><Paths><Quantity>$total_paths</Quantity><Items>$path_content</Items></Paths><CallerReference>$identifier</CallerReference><...
}

42;
__END__
=encoding utf8

=head1 NAME

Amazon::CloudFront::Thin - A thin, lightweight, low-level Amazon CloudFront client

=head1 SYNOPSIS

    use Amazon::CloudFront::Thin;

    my $cloudfront = Amazon::CloudFront::Thin->new({

lib/Amazon/CloudFront/Thin.pm  view on Meta::CPAN

for more information on how to interpret errors returned as responses.

=head1 HANDLING UNICODE FILENAMES & PATHS

Amazon appears to reference filenames containing non ASCII characters
by URL Encoding the filenames. The following code takes a path such as
C<"events/الابحاث"> which contains both a slash to indicate a directory
boundary and a non-ascii filename and creates an invalidation:

    use Amazon::CloudFront::Thin;
    use URL::Encode qw( url_encode_utf8 );

    my $cloudfront = Amazon::CloudFront::Thin::->new( ... );

    my $encoded_filename = url_encode_utf8($path);

    # "/" will be encoded as %2F, but we want it as "/"
    $encoded_filename    =~ s!%2F!/!g;

    $cloudfront->create_invalidation( '/' . $encoded_filename );


=head1 AUTHOR

Breno G. de Oliveira C<< garu at cpan.org >>



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