mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-15 16:57:10 +00:00
Merge pull request #359 from yurykats/issue358
Issue 358: Remove optional parameter from Content-Type header
This commit is contained in:
commit
b281328ff4
@ -724,6 +724,11 @@ mode_t get_mode(headers_t& meta, const char* path, bool checkdir, bool forcedir)
|
|||||||
}else{
|
}else{
|
||||||
if(meta.end() != (iter = meta.find("Content-Type"))){
|
if(meta.end() != (iter = meta.find("Content-Type"))){
|
||||||
string strConType = (*iter).second;
|
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"){
|
if(strConType == "application/x-directory"){
|
||||||
mode |= S_IFDIR;
|
mode |= S_IFDIR;
|
||||||
}else if(path && 0 < strlen(path) && '/' == path[strlen(path) - 1]){
|
}else if(path && 0 < strlen(path) && '/' == path[strlen(path) - 1]){
|
||||||
|
Loading…
Reference in New Issue
Block a user