Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

Patch for Catalyst-Plugin-Static-0.07

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


catalyst.miscatzoom.de

Jul 15, 2005, 5:17 PM

Post #1 of 4 (1348 views)
Permalink
Patch for Catalyst-Plugin-Static-0.07

I had problems installing File::MimeInfo::Magic on win32 so I would suggest using LWP::MediaTypes instead:



use LWP::MediaTypes qw(guess_media_type);

...

my $type = shift || guess_media_type $path;





One can still use File::MimeInfo::Magic within the application and supply mimetype as an argument to Static.



Would that be ok?

Matthias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst-dev/attachments/20050715/01634e5b/attachment.htm


andyathybridized.org

Jul 15, 2005, 5:53 PM

Post #2 of 4 (1256 views)
Permalink
Patch for Catalyst-Plugin-Static-0.07 [In reply to]

Matthias Waldorf wrote:
> I had problems installing File::MimeInfo::Magic on win32 so I would
> suggest using LWP::MediaTypes instead:

I agree that there needs to be a better solution than using
File::MimeInfo, but LWP::MediaTypes seems a bit sparse on the types it
recognizes. For example, I don't even see text/css in the media.types
file. Firefox will not render a page properly if you don't send your
css files as text/css, and I know this has caused problems for many
people, since text/css was missing in older versions of shared-mime-info
too.

-Andy


catalyst.miscatzoom.de

Jul 15, 2005, 10:22 PM

Post #3 of 4 (1255 views)
Permalink
Patch for Catalyst-Plugin-Static-0.07 [In reply to]

Dear Andy,

you are right, LWP::MediaTypes needs help for some files. I used to call it
like this (this solves the problem with Firefox):

use LWP::MediaTypes qw(add_type guess_media_type);
BEGIN {
add_type 'text/css' => qw(css);
}

This could either be done inside Static.pm or within the calling
application. I'm sure there are better solutions, but LWP::MediaTypes should
be available everywhere and you can still use another module and pass the
mimetype to Static.pm.

With kind regards,
Matthias


rob.kinyonatgmail.com

Jul 21, 2005, 4:27 PM

Post #4 of 4 (1254 views)
Permalink
Patch for Catalyst-Plugin-Static-0.07 [In reply to]

On 7/15/05, Andy Grundman <andy [at] hybridized> wrote:
> Matthias Waldorf wrote:
> > I had problems installing File::MimeInfo::Magic on win32 so I would
> > suggest using LWP::MediaTypes instead:
>
> I agree that there needs to be a better solution than using
> File::MimeInfo, but LWP::MediaTypes seems a bit sparse on the types it
> recognizes. For example, I don't even see text/css in the media.types
> file. Firefox will not render a page properly if you don't send your
> css files as text/css, and I know this has caused problems for many
> people, since text/css was missing in older versions of shared-mime-info
> too.

What about using File::MimeInfo if it's available, otherwise dropping
into LWP::MediaTypes if it's not and adding the necessary items?

Rob

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.