[Maypole] content-type forced to text/html

Dave Howorth dhoworth@mrc-lmb.cam.ac.uk
Thu, 02 Dec 2004 10:20:05 +0000


Sebastian Riedel wrote:
> Benjamin Reed:
>>I've started setting up a simple site using maypole, but I'm running 
>>into an annoying rendering issue in firefox because anything under the 
>>control of maypole gets sent as "text/html", even if it's just passing 
>>through serving a .css file to apache proper.
>>
>>Is there a way to tell maypole to server it's own stuff as text/html, 
>>but for anything else to *not* set the content-type, and let apache 
>>figure it out?
> 
> No it's not that simple, when Maypole sends you a css file it's handling
> it like a normal TT2 template, it doesn't know it isn't.
> 
> You can put something like this in your additional_data()
> 
> $r->content_type('text/css') if $r->template =~ /\.css$/;
> 
> or this in your css file. ;)
> 
> [% request.content_type('text/css') %]

Another alternative is just to make the reference to the css file an 
absolute URL so the request for it never goes through Maypole at all.

Cheers, Dave