On Wed, Mar 12, 2003 at 11:25:35AM +0000, Andy Wardley wrote:
>
> Any others that I've missed?
Could form an opinion about the below patch and apply it if you like it?
On Tue, Feb 04, 2003 at 09:30:02PM +0100, Bart Schuller wrote:
Hello,
I bumped into a small limitation in A::T in that the content-type is
hardwired to always be text/html. So my browsers have been quite
forgiving with my templated CSS file. But now that I needed a Java
Webstart file templatized, the problem had to be solved. It shouldn't
take more than a few minutes, and it didn't.
Usage:
[% META
content_type = 'text/plain';
-%]
And the patch:
--- Apache-Template-0.06.orig/lib/Template/Service/Apache.pm 2002-01-22
15:11:51.000000000 +0100
+++ Apache-Template-0.06/lib/Template/Service/Apache.pm 2003-02-04 14:20:35.000000000
+0100
@@ -154,7 +154,9 @@
my $headers = $self->{ SERVICE_HEADERS };
my $all = $headers->{ all };
- $r->content_type('text/html');
+ my $content_type = $template->content_type() || 'text/html';
+
+ $r->content_type($content_type);
$r->headers_out->add('Last-Modified' => ht_time($template->modtime()))
if $all or $headers->{ modified } and $template;
$r->headers_out->add('Content-Length' => length $$content)
--
Bart.
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates