mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-25 00:00:52 -04:00
Explicitly register supported mime types (#82)
This commit is contained in:
+11
-2
@@ -41,8 +41,6 @@ def send_json(env, json)
|
||||
end
|
||||
|
||||
def send_attachment(env, path)
|
||||
MIME.register ".cbz", "application/vnd.comicbook+zip"
|
||||
MIME.register ".cbr", "application/vnd.comicbook-rar"
|
||||
send_file env, path, filename: File.basename(path), disposition: "attachment"
|
||||
end
|
||||
|
||||
@@ -164,3 +162,14 @@ def escape_xml(str)
|
||||
'&' => "&",
|
||||
})
|
||||
end
|
||||
|
||||
def register_mime_types
|
||||
{
|
||||
".zip" => "application/zip",
|
||||
".rar" => "application/x-rar-compressed",
|
||||
".cbz" => "application/vnd.comicbook+zip",
|
||||
".cbr" => "application/vnd.comicbook-rar",
|
||||
}.each do |k, v|
|
||||
MIME.register k, v
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user