Merge pull request #1282 from gaul/mime

Warn about missing MIME types instead of exiting
This commit is contained in:
Takeshi Nakatani 2020-05-03 15:15:05 +09:00 committed by GitHub
commit a4803543a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -650,7 +650,7 @@ bool S3fsCurl::InitMimeType(const std::string& strFile)
}
}
if(MimeFile.empty()){
S3FS_PRN_ERR("Could not find miime.types files, you have to create file(%s) or specify mime option for existing mime.types file.", errPaths.c_str());
S3FS_PRN_WARN("Could not find mime.types files, you have to create file(%s) or specify mime option for existing mime.types file.", errPaths.c_str());
return false;
}
}
@ -684,7 +684,7 @@ bool S3fsCurl::InitMimeType(const std::string& strFile)
}
S3FS_PRN_INIT_INFO("Loaded mime information from %s", MimeFile.c_str());
}else{
S3FS_PRN_ERR("Could not load mime types from %s, please check the existence and permissions of this file.", MimeFile.c_str());
S3FS_PRN_WARN("Could not load mime types from %s, please check the existence and permissions of this file.", MimeFile.c_str());
return false;
}
return true;

View File

@ -5241,10 +5241,7 @@ int main(int argc, char* argv[])
// init mime types for curl
if(!S3fsCurl::InitMimeType(mimetype_file)){
S3FS_PRN_EXIT("Could not load mime types for curl library.");
S3fsCurl::DestroyS3fsCurl();
s3fs_destroy_global_ssl();
exit(EXIT_FAILURE);
S3FS_PRN_WARN("Missing MIME types prevents setting Content-Type on uploaded objects.");
}
// [NOTE]