aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/filehandle.go
diff options
context:
space:
mode:
authorbs106 <bs106@student.ugal.ro>2019-12-17 09:47:12 +0000
committerbs106 <bs106@student.ugal.ro>2019-12-17 09:47:12 +0000
commitce79a31448e16ec55f5efb7c02bb5118454582c3 (patch)
treed10153757d1dd9d30460e8df7cdaf5c0ed8f4de4 /weed/filesys/filehandle.go
parent5961e0d9eb35492e44ad8ee059a1d177e667d8dc (diff)
downloadseaweedfs-ce79a31448e16ec55f5efb7c02bb5118454582c3.tar.xz
seaweedfs-ce79a31448e16ec55f5efb7c02bb5118454582c3.zip
Fix missing leading dot in extension
Diffstat (limited to 'weed/filesys/filehandle.go')
-rw-r--r--weed/filesys/filehandle.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index 645bdc92e..101f5c056 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -92,9 +92,9 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f
if req.Offset == 0 {
// detect mime type
- var possibleExt string
- fh.contentType, possibleExt = mimetype.Detect(req.Data)
- if ext := path.Ext(fh.f.Name); ext != possibleExt {
+ detectedMIME := mimetype.Detect(req.Data)
+ fh.contentType = detectedMIME.String()
+ if ext := path.Ext(fh.f.Name); ext != detectedMIME.Extension() {
fh.contentType = mime.TypeByExtension(ext)
}