diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-07-15 19:57:28 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-07-15 19:57:28 -0400 |
commit | 70c4ccad4bc5464324d4321422bc5d13f8669204 (patch) | |
tree | 7659ffc70f93540e90b9f3ed026a4bc6b364d621 /src/guff/asset-mime-type.cr | |
parent | 7577c32a83d2897617fb60f488d6d71cd23be698 (diff) | |
download | guff-70c4ccad4bc5464324d4321422bc5d13f8669204.tar.xz guff-70c4ccad4bc5464324d4321422bc5d13f8669204.zip |
move asset-mime-type, config, iso8601, paged-result-set, and password to separate files
Diffstat (limited to 'src/guff/asset-mime-type.cr')
-rw-r--r-- | src/guff/asset-mime-type.cr | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/guff/asset-mime-type.cr b/src/guff/asset-mime-type.cr new file mode 100644 index 0000000..ee3826c --- /dev/null +++ b/src/guff/asset-mime-type.cr @@ -0,0 +1,20 @@ +module Guff::AssetMimeType + TYPES = { + ".js" => "text/javascript; charset=utf-8", + ".css" => "text/css; charset=utf-8", + ".html" => "text/html; charset=utf-8", + ".png" => "image/png", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".otf" => "application/vnd.ms-opentype", + ".eot" => "application/vnd.ms-fontobject", + ".svg" => "image/svg+xml", + ".ttf" => "application/x-font-ttf", + ".woff" => "application/font-woff", + ".woff2" => "application/font-woff", + } + + def self.from_path(path : String) : String + TYPES[File.extname(path)]? || "application/octet-stream" + end +end |