Merge: Added contributing guidelines and link from readme
[nit.git] / lib / nitcorn / media_types.nit
index bf5d74a..305f314 100644 (file)
@@ -20,6 +20,8 @@ module media_types
 
 # Map of known MIME types
 class MediaTypes
+
+       # MIME types by extensions.
        protected var types = new HashMap[String, String]
 
        # Get the type/subtype associated to a file extension `ext`
@@ -51,6 +53,7 @@ class MediaTypes
                types["jar"]        = "application/java-archive"
                types["war"]        = "application/java-archive"
                types["ear"]        = "application/java-archive"
+               types["json"]       = "application/json"
                types["hqx"]        = "application/mac-binhex40"
                types["pdf"]        = "application/pdf"
                types["cco"]        = "application/x-cocoa"
@@ -95,7 +98,15 @@ class MediaTypes
                types["asx"]        = "video/x-ms-asf"
                types["asf"]        = "video/x-ms-asf"
                types["mng"]        = "video/x-mng"
+               types["apk"]        = "application/vnd.android.package-archive"
+               types["svg"]        = "image/svg+xml"
+               types["ttf"]        = "application/x-font-ttf"
+               types["otf"]        = "application/x-font-opentype"
+               types["eof"]        = "application/vnd.ms-fontobject"
+               types["woff"]       = "application/font-woff"
+               types["woff2"]      = "application/font-woff2"
        end
 end
 
+# MIME types list.
 fun media_types: MediaTypes do return once new MediaTypes