View | Details | Raw Unified | Return to bug 43679
Collapse All | Expand All

(-)httpd-test/perl-framework/t/apache/subrequests.t (+60 lines)
Line 0 Link Here
1
use strict;
2
use warnings FATAL => 'all';
3
4
use Apache::Test;
5
use Apache::TestRequest;
6
use Apache::TestUtil;
7
8
plan tests => 6, have_module qw(mod_negotiation mod_mime);
9
10
## Returns ok if the returned content-type value is the same as the 
11
## expected one.
12
#
13
sub check_content_type  
14
{
15
    my $path = shift;
16
    my $expected = shift;
17
    my $error_msg = shift;
18
19
    my $h = HEAD_STR $path;
20
21
    ## parse response headers looking for our headers
22
    my $actual_value;
23
    foreach my $head (split /\n/, $h) {
24
	if ($head =~ /^Content-Type: (.*)$/) {
25
	    $actual_value = $1;
26
	    last;
27
	}
28
    }
29
30
    ok t_cmp($actual_value, $expected, $error_msg);
31
	
32
}
33
34
## The server is configured to return text/html; charset=iso8859-1 by default
35
## The different section overrides change this to charset=bogus. 
36
## We do the test with and without content-negotiation
37
38
my $expected_type = "text/html; charset=bogus";
39
40
check_content_type ("/apache/subrequests/dir_override/hello.html.bc", 
41
		    $expected_type,
42
		    "subrequests with <Directory> overrides");
43
check_content_type ("/apache/subrequests/dir_override/hello", 
44
		    $expected_type,
45
		    "subrequests with <Directory> overrides and conn-neg");
46
47
check_content_type ("/apache/subrequests/location_override/hello.html.bc",
48
		    $expected_type,
49
		    "subrequests with <Location> overrides");
50
check_content_type ("/apache/subrequests/location_override/hello",
51
		    $expected_type,
52
		    "subrequests with <Location> overrides and conn-neg");
53
54
check_content_type ("/apache/subrequests/htaccess_override/hello.html.bc",
55
		    $expected_type,
56
		    "subrequests with .htaccess overrides");
57
check_content_type ("/apache/subrequests/htaccess_override/hello",
58
		    $expected_type,
59
		    "subrequests with .htaccess overrides and conn-neg");
60
(-)httpd-test/perl-framework/t/htdocs/apache/subrequests/location_override/hello.html.bc (+11 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
  <title>Hellow World</title>
6
</head>
7
8
<body>
9
 <p>Hello World</p>
10
</body>
11
</html>
(-)httpd-test/perl-framework/t/htdocs/apache/subrequests/htaccess_override/hello.html.bc (+11 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
  <title>Hellow World</title>
6
</head>
7
8
<body>
9
 <p>Hello World</p>
10
</body>
11
</html>
(-)httpd-test/perl-framework/t/htdocs/apache/subrequests/htaccess_override/.htaccess (+1 lines)
Line 0 Link Here
1
AddCharset bogus .bc
(-)httpd-test/perl-framework/t/htdocs/apache/subrequests/dir_override/hello.html.bc (+11 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
  <title>Hellow World</title>
6
</head>
7
8
<body>
9
 <p>Hello World</p>
10
</body>
11
</html>
(-)httpd-test/perl-framework/t/conf/extra.conf.in (+30 lines)
Lines 153-158 Link Here
153
</IfModule>
153
</IfModule>
154
154
155
##
155
##
156
## subrequests test config
157
## 
158
159
<IfDefine APACHE2>
160
  <IfModule mod_mime.c>
161
     
162
     <IfModule mod_negotiation.c>
163
164
      AddType text/html html htm
165
      AddDefaultCharset iso-8859-1
166
167
       <Directory "@SERVERROOT@/htdocs/apache/subrequests/dir_override/">
168
          Options +MultiViews
169
	  AddCharset bogus .bc
170
       </Directory>
171
172
       <LocationMatch  "^/apache/subrequests/location_override/">
173
          Options +MultiViews
174
	  AddCharset bogus .bc
175
       </LocationMatch>
176
177
       <Directory "@SERVERROOT@/htdocs/apache/subrequests/htaccess_override/">
178
          Options +MultiViews
179
          AllowOverride FileInfo
180
       </Directory>
181
182
     </IfModule>
183
  </IfModule>
184
</IfDefine>
185
156
## mod_rewrite test config
186
## mod_rewrite test config
157
##
187
##
158
188

Return to bug 43679