Changeset 1054
- Timestamp:
- 06/10/07 14:45:21 (18 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 modified
-
MANIFEST (modified) (1 diff)
-
lib/OpenGuides/Template.pm (modified) (2 diffs)
-
t/50_http_response_codes.t (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/MANIFEST
r1050 r1054 115 115 t/48_google_analytics.t 116 116 t/49_custom_header.t 117 t/50_http_response_codes.t 117 118 t/51_display_node.t 118 119 t/52_display_diffs.t -
trunk/lib/OpenGuides/Template.pm
r1047 r1054 109 109 Content-Type: defaults to C<text/html> and is omitted if the 110 110 C<content_type> arg is explicitly set to the blank string. 111 112 The HTTP response code may be explictly set with the C<http_status> arg. 111 113 112 114 =cut … … 181 183 182 184 my $header = ""; 183 unless ( defined $args{content_type} and $args{content_type} eq "" ) { 184 my $content_type; 185 if ($args{content_type}) { 186 $content_type = $args{content_type}; 185 my %cgi_header_args; 186 187 if ( defined $args{content_type} and $args{content_type} eq "" ) { 188 $cgi_header_args{'-type'} = ''; 189 } else { 190 if ( $args{content_type} ) { 191 $cgi_header_args{'-type'} = $args{content_type}; 187 192 } else { 188 $content_type = "text/html"; 189 } 190 if ($tt_vars->{http_charset}) { 191 $content_type .= "; charset=".$tt_vars->{http_charset}; 192 } 193 $header = CGI::header( -type => $content_type, -cookie => $args{cookies} ); 194 } 193 $cgi_header_args{'-type'} = "text/html"; 194 } 195 if ( $tt_vars->{http_charset} ) { 196 $cgi_header_args{'-type'} .= "; charset=".$tt_vars->{http_charset}; 197 } 198 # XXX should possibly not be inside this block, but retaining 199 # existing functionality for now. See 200 # http://dev.openguides.org/ticket/220 201 $cgi_header_args{'-cookie'} = $args{cookies}; 202 } 203 204 if ( $args{http_status} ) { 205 $cgi_header_args{'-status'} = $args{http_status}; 206 } 207 208 $header = CGI::header( %cgi_header_args ); 195 209 196 210 # vile hack
