From 722b7f5a6834f2ca6c8ea03aa3a7c96a7a84873c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 15:43:00 +0200 Subject: Adding debian version 2.4.59-1~deb12u1. Signed-off-by: Daniel Baumann --- debian/perl-framework/t/apache/pr64339.t | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 debian/perl-framework/t/apache/pr64339.t (limited to 'debian/perl-framework/t/apache/pr64339.t') diff --git a/debian/perl-framework/t/apache/pr64339.t b/debian/perl-framework/t/apache/pr64339.t new file mode 100644 index 0000000..00097e6 --- /dev/null +++ b/debian/perl-framework/t/apache/pr64339.t @@ -0,0 +1,46 @@ + +use strict; +use warnings FATAL => 'all'; + +use Apache::Test; +use Apache::TestUtil; +use Apache::TestRequest; + +my @testcases = ( + # Backend sends Content-Type: application/xml; charset=utf-8 + ['/doc.xml', "application/xml; charset=utf-8", "fóó\n" ], + + # Backend sends Content-Type: application/foo+xml; charset=utf-8 + ['/doc.fooxml', "application/foo+xml; charset=utf-8", "fóó\n" ], + + # Backend sends Content-Type: application/notreallyxml (no charset) + # This should NOT be transformed or have a charset added. + ['/doc.notxml', "application/notreallyxml", "f\xf3\xf3\n" ], + + # Sent with charset=ISO-8859-1 - should be transformed to utf-8 + ['/doc.isohtml', "text/html;charset=utf-8", "

fóó\n

" ], +); + +# mod_xml2enc on trunk behaves quite differently to the 2.4.x version +# after r1785780, and does NOT transform the response body. Unclear if +# this is a regression, so restricting this test to 2.4.x (for now). + +if (have_min_apache_version('2.5.0')) { + print "1..0 # skip: Test only valid for 2.4.x"; + exit 0; +} + +if (not have_min_apache_version('2.4.59')) { + print "1..0 # skip: Test not valid before 2.4.59"; + exit 0; +} + +plan tests => (3*scalar @testcases), need [qw(xml2enc alias proxy_html proxy)]; + +foreach my $t (@testcases) { + my $r = GET("/modules/xml2enc/front".$t->[0]); + + ok t_cmp($r->code, 200, "fetching ".$t->[0]); + ok t_cmp($r->header('Content-Type'), $t->[1], "content-type header test for ".$t->[0]); + ok t_cmp($r->content, $t->[2], "content test for ".$t->[0]); +} -- cgit v1.2.3