[Catalyst] Re: Catalyst, Firefox and SVG

Brandon Black blblack at gmail.com
Mon Dec 12 03:33:35 CET 2005


On 12/9/05, Maurice Height <mauriceh at bigpond.net.au> wrote:
> Andy Grundman wrote:
>
> > Firefox is a stickler for MIME types, and the latest version of
> > MIME::Types does not include one for svg.  You will have to set the type
> > manually:
>
> > MyApp->config->{static}->{mime_types} = { svg => 'image/svg+xml' };
> >
> > Oh and I should say, that even though you have the type specified in your
> > html file, Static::Simple serves unknown types as text/plain, which is
> > most likely where the problem comes from.
>
> I think you nailed it, because I tried this in my test app:
>
> __PACKAGE__->config( name   => 'CatApp',
>                      root   => CatApp->path_to('root'),
>                      static => { mime_types => { svg => 'image/svg+xml' } },
> );
>
> but it did not stop FireFox from displaying the SVG content as text
> (Internet Explorer is OK).
> At this stage I do not have a clue how to fix this.
> While I can use IE as a workaround for now, is this problem something that
> can be fixed in Catalyst or MIME::Types?
>

Can you save the svg output as a static file and serve it staticly as
image/svg+xml and get firefox to work?  I seem to remember it's also a
stickler about the first few lines of your svg xml (the xml prolog or
lack thereof, the doctype or lack thereof, and the svg xmlns
attribute, etc).  Last time I played with svg, I had to spend a lot of
time getting just the right combination of both mimetype and first few
lines to get it to work right on both IE and FF.



More information about the Catalyst mailing list