Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Added MIME Types #64

Merged
merged 1 commit into from Jul 9, 2015
Merged

Added MIME Types #64

merged 1 commit into from Jul 9, 2015

Conversation

RehanSaeed
Copy link
Contributor

Added the following MIME types which I have found to be missing:

.json - application/json (This one is pretty unbelievable)
.ttc - application/x-font-ttf
.webp - image/webp
.appcache - text/cache-manifest
.manifest - text/cache-manifest

Also the following MIME types need updating:

.ttf should be application/x-font-ttf and not application/octet-stream

Added the following MIME types which I have found to be missing:

.json - application/json (This one is pretty unbelievable)
.ttc - application/x-font-ttf
.webp - image/webp
.appcache - text/cache-manifest
.manifest - text/cache-manifest

Also the following MIME types need updating:

.ttf should be application/x-font-ttf and not application/octet-stream
@dnfclas
Copy link

dnfclas commented Jul 7, 2015

Hi @RehanSaeed, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, DNFBOT;

@Tratcher
Copy link
Member

Tratcher commented Jul 8, 2015

What are your references for these definitions?

@RehanSaeed
Copy link
Contributor Author

Officially recognised MIME types:

There is no official standard MIME type for ttf, ttc and webp. However, these are common enough and I've gathered up whatever sources I can:

  • .ttf is already included in the list but as application/octet-stream. However this causes a common warning to show in Chrome. See StackOverflow and Google Chrome. The solution is to use application/x-font-ttf where the x- signifies that this is non-standard. Some people use application/font-ttf instead however.
  • ttc is a true type font collection and has similar problems in Chrome. Unfortunately I can't find an authoritative source for this one and I haven't written a comment about this one in my list. However HTML 5 Boilerplate has it listed as application/x-font-ttf.
  • .webp - image/webp and HTML 5 Boilerplate. The first link is the official Google docs. It's worth noting that Chrome and Opera already support this format and other browsers can be supported using a shim. WebM is already in the list also.

Interestingly, HTML 5 Boilerplate has the following comment about the ttf and ttc font MIME types:

    # Browsers usually ignore the font media types and simply sniff
    # the bytes to figure out the font type.
    # https://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern
    #
    # However, Blink and WebKit based browsers will show a warning
    # in the console if the following font types are served with any
    # other media types.

It's amazing to me how much of the web is not standardised and people have just somehow settled on 'what works'.

@Tratcher
Copy link
Member

Tratcher commented Jul 9, 2015

@blowdart do you care about any of these?

@blowdart
Copy link
Member

blowdart commented Jul 9, 2015

Nope, you can merge at will.

@Tratcher Tratcher merged commit 545fa9e into aspnet:dev Jul 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants