|
|
|
|
@ -176,14 +176,14 @@ std::string WebServerClient::GetFileType (std::string fname) {
|
|
|
|
|
|
|
|
|
|
std::string suffix = string_to_lower (fname.substr(pos));
|
|
|
|
|
|
|
|
|
|
if (suffix.compare (".html") == 0) return res;
|
|
|
|
|
if (suffix.compare (".htm") == 0) return res;
|
|
|
|
|
if (suffix.compare (".js") == 0) return res;
|
|
|
|
|
if (suffix.compare (".json") == 0) return "application/json; charset=utf-8";
|
|
|
|
|
if (suffix.compare (".svg") == 0) return "image/svg+xml";
|
|
|
|
|
if (suffix.compare (".png") == 0) return "image/png";
|
|
|
|
|
if (suffix.compare (".jpg") == 0) return "image/jpeg";
|
|
|
|
|
if (suffix.compare (".jpeg") == 0) return "image/jpeg";
|
|
|
|
|
if (suffix.find (".html") != std::string::npos) return res;
|
|
|
|
|
if (suffix.find (".htm") != std::string::npos) return res;
|
|
|
|
|
if (suffix.find (".js") != std::string::npos) return res;
|
|
|
|
|
if (suffix.find (".json") != std::string::npos) return "application/json; charset=utf-8";
|
|
|
|
|
if (suffix.find (".svg") != std::string::npos) return "image/svg+xml";
|
|
|
|
|
if (suffix.find (".png") != std::string::npos) return "image/png";
|
|
|
|
|
if (suffix.find (".jpg") != std::string::npos) return "image/jpeg";
|
|
|
|
|
if (suffix.find (".jpeg") != std::string::npos) return "image/jpeg";
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
};
|
|
|
|
|
|