240 std::string MimeTypes::contentType(
const std::string& file) {
241 const std::map<std::string, std::string>::iterator it = mimeType.find(std::filesystem::path(file).extension());
245 if (it != mimeType.end()) {
249 else if (magic !=
nullptr) {
250 const char* magicType = magic_file(MimeTypes::magic, file.c_str());
251 type = magicType !=
nullptr ? magicType : std::string();
255 return !type.empty() ? type :
"application/octet-stream";