Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can MIME types of Github Pages files be configured?

We have an MP4 video file in a Github Pages repository. The file is being served with a MIME type of application/octet-stream, which means Internet Explorer doesn't like it. It should be served as type video/mp4. Is there a way to configure Github Pages to use the proper MIME type, or should we find an alternate hosting solution for the video? This topic isn't addressed in the help pages.

like image 492
pjmorse Avatar asked Apr 11 '13 14:04

pjmorse


People also ask

How do I assign a MIME type?

In the Connections pane, go to the site, application, or directory for which you want to add a MIME type. In the Home pane, double-click MIME Types. In the MIME Types pane, click Add... in the Actions pane. In the Add MIME Type dialog box, add the file name extension and MIME type, and then click OK.

What are MIME types for files?

Currently, there are ten registered types: application, audio, example, font, image, message, model, multipart, text, and video.

Is MIME type same as file type?

Whereas file extensions are commonly used for your OS to decide what program to open a file with, Mime types are used by your browser to decide how to present some data (or the server on how to interpret received data).

Where are MIME types stored?

All MIME type information is stored in a database. The MIME database is located in the directory /usr/share/mime/ . The MIME database contains a large number of common MIME types, stored in the file /usr/share/mime/packages/freedesktop.


1 Answers

The topic is addressed here: https://help.github.com/articles/mime-types-on-github-pages/

GitHub Pages supports more than 750 MIME types across 1,000s of file extensions. The list of supported MIME types is generated from the mime-db project, which aggregates MIME types from the Apache and Nginx projects as well as the official IANA list of internet content types.

MIME types are additional headers that servers send to provide browsers with information about the types of files being requested and how to handle the file once downloaded.

To add or modify MIME types for use on GitHub Pages, see the mime-db Contributing instructions.

The mime-db project is currently reporting mp4 as video/mp4:

"video/mp4": {
  "source": "apache",
  "compressible": false,
  "extensions": ["mp4","mp4v","mpg4"]
},

Source: https://github.com/jshttp/mime-db/blob/46a40f0524a01fb3075a7ecde92e8e04fc93d599/db.json#L6233

If Github pages is still reporting mp4 files as application/octet-stream you should contact Github support.

like image 130
13rac1 Avatar answered Sep 18 '22 13:09

13rac1