From 230991782b6ee5d43d9781e4f13d0bd05e1eda10 Mon Sep 17 00:00:00 2001 From: yurykats Date: Mon, 8 Feb 2016 16:39:56 -0500 Subject: [PATCH] Update s3fs_util.cpp --- src/s3fs_util.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/s3fs_util.cpp b/src/s3fs_util.cpp index 0f5b50d..8a9e324 100644 --- a/src/s3fs_util.cpp +++ b/src/s3fs_util.cpp @@ -724,6 +724,11 @@ mode_t get_mode(headers_t& meta, const char* path, bool checkdir, bool forcedir) }else{ if(meta.end() != (iter = meta.find("Content-Type"))){ string strConType = (*iter).second; + // Leave just the mime type, remove any optional parameters (eg charset) + string::size_type pos = strConType.find(";"); + if(string::npos != pos){ + strConType = strConType.substr(0, pos); + } if(strConType == "application/x-directory"){ mode |= S_IFDIR; }else if(path && 0 < strlen(path) && '/' == path[strlen(path) - 1]){