From b7a654a31855f994e05cefb97b1e7cdf2b2a5a00 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 28 Aug 2020 19:42:40 -0700 Subject: [PATCH] file mime avoid saving application/octet-stream --- weed/filer2/filerstore.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/weed/filer2/filerstore.go b/weed/filer2/filerstore.go index 7c518c6fe..ab1d0e659 100644 --- a/weed/filer2/filerstore.go +++ b/weed/filer2/filerstore.go @@ -63,6 +63,9 @@ func (fsw *FilerStoreWrapper) InsertEntry(ctx context.Context, entry *Entry) err }() filer_pb.BeforeEntrySerialization(entry.Chunks) + if entry.Mime == "application/octet-stream" { + entry.Mime = "" + } return fsw.ActualStore.InsertEntry(ctx, entry) } @@ -74,6 +77,9 @@ func (fsw *FilerStoreWrapper) UpdateEntry(ctx context.Context, entry *Entry) err }() filer_pb.BeforeEntrySerialization(entry.Chunks) + if entry.Mime == "application/octet-stream" { + entry.Mime = "" + } return fsw.ActualStore.UpdateEntry(ctx, entry) }