Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

deal correctly with attachments with no extension as binary streams

  • Loading branch information...
commit 1d79f21d864501e106604ea39e32f0cb40ee3f84 1 parent fa0b606
@avsm authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 sql_mirror.ml
View
4 sql_mirror.ml
@@ -39,7 +39,9 @@ let resolve_attachments rootdir fname db uid =
if Sys.file_exists attfname then begin
let a = match Attachment.get_by_file_name attfname db with
|[] ->
- let mime_type = Magic_mime.lookup (get_extension attfname) in
+ let mime_type = try
+ Magic_mime.lookup (get_extension attfname)
+ with _ -> "application/octet-stream" in
Attachment.t ~file_name:attfname ~mime_type db
|[a] -> a
|_ -> assert false in
Please sign in to comment.
Something went wrong with that request. Please try again.