diff options
| author | yanyiwu <wuyanyi09@foxmail.com> | 2015-05-16 18:55:58 +0800 |
|---|---|---|
| committer | yanyiwu <wuyanyi09@foxmail.com> | 2015-05-16 18:55:58 +0800 |
| commit | 96b73e3e94a30c583753ae5aef876155c3fa3b79 (patch) | |
| tree | 3ed78cbaaedb8a136d6b3cc1bc20407d4fe6383c /go | |
| parent | 3188382ea741ec607f58df13d8609607cf42ab39 (diff) | |
| download | seaweedfs-96b73e3e94a30c583753ae5aef876155c3fa3b79.tar.xz seaweedfs-96b73e3e94a30c583753ae5aef876155c3fa3b79.zip | |
if mt != "application/octet-stream"
became
if !strings.HasPrefix(mt, "application/octet-stream")
In our situation,
mt can be 'application/octet-stream;charset=ISO-8859-1',
so I think HasPrefix will be more accurate.
Diffstat (limited to 'go')
| -rw-r--r-- | go/weed/weed_server/volume_server_handlers_read.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/go/weed/weed_server/volume_server_handlers_read.go b/go/weed/weed_server/volume_server_handlers_read.go index 52c8e79cb..a8156e85b 100644 --- a/go/weed/weed_server/volume_server_handlers_read.go +++ b/go/weed/weed_server/volume_server_handlers_read.go @@ -89,7 +89,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) } if n.MimeSize > 0 { mt := string(n.Mime) - if mt != "application/octet-stream" { + if !strings.HasPrefix(mt, "application/octet-stream") { mtype = mt } } |
