Re: [Maypole] content-type forced to text/html

From: Simon Flack (sf at flacks.net)
Date: Thu Dec 02 2004 - 12:29:41 GMT


Dave Howorth wrote:
> 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.

Another option I've been mulling over is to add File::Type or
File::MMagic to the list of dependencies, and auto-detect the mime type.

--simonflk

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT