don't use boost string algorithm
This commit is contained in:
+23
-23
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "boost/algorithm/string.hpp"
|
||||
#include "webcc/string.h"
|
||||
|
||||
namespace webcc {
|
||||
|
||||
@@ -21,29 +21,29 @@ const char DOUBLE_DASHES[2] = { '-', '-' };
|
||||
namespace media_types {
|
||||
|
||||
std::string FromExtension(const std::string& ext) {
|
||||
using boost::iequals;
|
||||
std::string lext = tolower(ext);
|
||||
|
||||
if (iequals(ext, ".htm")) { return "text/html"; }
|
||||
if (iequals(ext, ".html")) { return "text/html"; }
|
||||
if (iequals(ext, ".php")) { return "text/html"; }
|
||||
if (iequals(ext, ".css")) { return "text/css"; }
|
||||
if (iequals(ext, ".txt")) { return "text/plain"; }
|
||||
if (iequals(ext, ".js")) { return "application/javascript"; }
|
||||
if (iequals(ext, ".json")) { return "application/json"; }
|
||||
if (iequals(ext, ".xml")) { return "application/xml"; }
|
||||
if (iequals(ext, ".swf")) { return "application/x-shockwave-flash"; }
|
||||
if (iequals(ext, ".flv")) { return "video/x-flv"; }
|
||||
if (iequals(ext, ".png")) { return "image/png"; }
|
||||
if (iequals(ext, ".jpe")) { return "image/jpeg"; }
|
||||
if (iequals(ext, ".jpeg")) { return "image/jpeg"; }
|
||||
if (iequals(ext, ".jpg")) { return "image/jpeg"; }
|
||||
if (iequals(ext, ".gif")) { return "image/gif"; }
|
||||
if (iequals(ext, ".bmp")) { return "image/bmp"; }
|
||||
if (iequals(ext, ".ico")) { return "image/vnd.microsoft.icon"; }
|
||||
if (iequals(ext, ".tiff")) { return "image/tiff"; }
|
||||
if (iequals(ext, ".tif")) { return "image/tiff"; }
|
||||
if (iequals(ext, ".svg")) { return "image/svg+xml"; }
|
||||
if (iequals(ext, ".svgz")) { return "image/svg+xml"; }
|
||||
if (lext == ".htm") { return "text/html"; }
|
||||
if (lext == ".html") { return "text/html"; }
|
||||
if (lext == ".php") { return "text/html"; }
|
||||
if (lext == ".css") { return "text/css"; }
|
||||
if (lext == ".txt") { return "text/plain"; }
|
||||
if (lext == ".js") { return "application/javascript"; }
|
||||
if (lext == ".json") { return "application/json"; }
|
||||
if (lext == ".xml") { return "application/xml"; }
|
||||
if (lext == ".swf") { return "application/x-shockwave-flash"; }
|
||||
if (lext == ".flv") { return "video/x-flv"; }
|
||||
if (lext == ".png") { return "image/png"; }
|
||||
if (lext == ".jpe") { return "image/jpeg"; }
|
||||
if (lext == ".jpeg") { return "image/jpeg"; }
|
||||
if (lext == ".jpg") { return "image/jpeg"; }
|
||||
if (lext == ".gif") { return "image/gif"; }
|
||||
if (lext == ".bmp") { return "image/bmp"; }
|
||||
if (lext == ".ico") { return "image/vnd.microsoft.icon"; }
|
||||
if (lext == ".tiff") { return "image/tiff"; }
|
||||
if (lext == ".tif") { return "image/tiff"; }
|
||||
if (lext == ".svg") { return "image/svg+xml"; }
|
||||
if (lext == ".svgz") { return "image/svg+xml"; }
|
||||
|
||||
return "application/text";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user