mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -04:00
Merge pull request #212 from int19h/211
Fix #211: getMimeTypeForFile does not handle files without extensions correctly
This commit is contained in:
commit
ccdfe9839d
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user