Merge pull request #212 from int19h/211

Fix #211: getMimeTypeForFile does not handle files without extensions correctly
This commit is contained in:
Kelson 2018-08-03 07:57:51 +00:00 committed by GitHub
commit ccdfe9839d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,7 @@ get_from_humanReadableBookId(const std::string& humanReadableBookId) {
static std::string getMimeTypeForFile(const std::string& filename)
{
std::string mimeType = "text/plain";
unsigned int pos = filename.find_last_of(".");
auto pos = filename.find_last_of(".");
if (pos != std::string::npos) {
std::string extension = filename.substr(pos + 1);