diff --git a/airdcpp-webapi/api/ViewFileApi.cpp b/airdcpp-webapi/api/ViewFileApi.cpp index c0730ae4..f7bf3a50 100644 --- a/airdcpp-webapi/api/ViewFileApi.cpp +++ b/airdcpp-webapi/api/ViewFileApi.cpp @@ -53,6 +53,7 @@ namespace webserver { } json ViewFileApi::serializeFile(const ViewFilePtr& aFile) noexcept { + auto mimeType = FileServer::getMimeType(aFile->getPath()); return{ { "id", aFile->getTTH().toBase32() }, { "tth", aFile->getTTH().toBase32() }, @@ -63,7 +64,7 @@ namespace webserver { { "type", Serializer::serializeFileType(aFile->getPath()) }, { "time_finished", aFile->getTimeFinished() }, { "downloaded", !aFile->isLocalFile() }, - { "mime_type", FileServer::getMimeType(aFile->getPath()) }, + { "mime_type", mimeType ? mimeType : Util::emptyString }, }; } diff --git a/airdcpp-webapi/web-server/FileServer.cpp b/airdcpp-webapi/web-server/FileServer.cpp index c4256005..ce789278 100644 --- a/airdcpp-webapi/web-server/FileServer.cpp +++ b/airdcpp-webapi/web-server/FileServer.cpp @@ -110,6 +110,7 @@ namespace webserver { { "bat", "text/plain" }, { "vb", "text/plain" }, { "cs", "text/plain" }, + { "nfo", "text/x-nfo" }, { "pl", "text/plain" }, { "py", "text/plain" }, { "class", "text/plain" },