Skip Menu |

This queue is for tickets about the File-MMagic CPAN distribution.

Report information
The Basics
Id: 14111
Status: open
Priority: 0/
Queue: File-MMagic

People
Owner: Nobody in particular
Requestors: info [...] whawes.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.24
Fixed in: (no value)



Subject: CSS and JS files incorrectly identified as text/plain
Version 1.24 incorrectly identifies CSS and JS files as text/plain. They should be text/css and text/javascript respectively. Behaviour observed on Win32 but also reported on other platforms. Regards wh
[guest - Thu Aug 11 06:58:50 2005]: Show quoted text
> Version 1.24 incorrectly identifies CSS and JS files as text/plain. > They should be text/css and text/javascript respectively. Behaviour > observed on Win32 but also reported on other platforms. > > Regards > > wh
There is no "magic" way to reliably identify such files. Your best bet is to use a module which can fall back to looking at the filename extension if magic doesn't come up with anything useful, eg File::MimeInfo.
From: ben [...] qolc.net
Show quoted text
> There is no "magic" way to reliably identify such files. Your best bet > is to use a module which can fall back to looking at the filename > extension if magic doesn't come up with anything useful, eg
File::MimeInfo. File::MMagic can and does (optionally) use file extensions and/or regular expression checks as well as magic; it's just that there is no built-in test for CSS or Javascript. See the manual entries for addSpecials and addFileExts for how to extend this yourself.