CSS File Folder warning - MIME type


(Emily) #1

Matrix Version: 5.5

A backend user was trying to regenerate the CSS File Folder after making updates to one of the CSS files it collates. The user has full Admin permissions for the folder and all the associated files.
(We do have “Auto regenerate” turned on, but do not rely on it.)

It failed to regenerate, and showed an error message:

(Yellow Box) Matrix Warning: “core_css.min.css”'s MIME type does not match its extension.
(Green Box) Matrix Notice: Error occurred when setting the file content.

The file that it says “MIME type does not match its extension” is the CSS File Folder.
Matrix saves it as a .min.css although we do not use the inbuilt minification (we Merge Without Minification).

We have a mixture of CSS Files and CSS Design Files that go into this File Folder. None have any HTML structures - just pure CSS and CSS comments.

When I - a System Administrator account - regenerate the file, it does not show any warning. But it continues to show one for the Backend User.

Any idea what could be causing this? Have you seen it before?

Thanks :slight_smile:
Emily


(Luke Wright) #2

Hi Emily,

I am curious as to what’s in the first CSS file that’s linked underneath it. The way detection of MIME types works, it’s possible that the contents are being detected as a non-plain text file - for instance, some keywords at the very start of the file, such as “.text” or “.even”, might cause it to be detected as an Assembler file, or “class” as a C++ file. I am able to replicate it when the very start of the file begins with these keywords, for instance.

This is not a problem with regular CSS files because the file is editable and thus it permits various “text” file types which these examples count as. It’s also not a problem with sys admins because I think they can bypass some of the file type restrictions.

I think I’m going to put something in our internal tracker so we can think about how to resolve this.


(Emily) #3

Hi Luke,

The start of the various files inside are:

  • /*! bootstrap info in comment tags */ :root
  • @font-face
  • body:after
  • /*! Flickity info in comment tags */ .flickity-enabled
  • *, h1, h2
  • .grey-input-wrap
  • .wizard

6 are “CSS Files”, and 3 are “CSS Design Files”.
The first file is the Bootstrap one.

Thanks for looking into this :slight_smile:
Emily