Amazon-CloudFront-Thin
view release on metacpan or search on metacpan
lib/Amazon/CloudFront/Thin.pm view on Meta::CPAN
}
sub _create_xml_payload {
my ($paths, $identifier) = @_;
my $total_paths = scalar @$paths;
my $path_content;
foreach my $path (@$paths) {
# leading '/' is required:
# http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/InvalidationBatchDatatype.html
$path = '/' . $path unless index($path, '/') == 0;
# we wrap paths on CDATA so we don't have to escape them
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__
( run in 0.472 second using v1.01-cache-2.11-cpan-c21f80fb71c )