Examples |
Classes | |
struct | mapping |
Functions | |
std::string | extension_to_type (const std::string &extension) |
Convert a file extension into a MIME type. | |
Variables | |
http::server::mime_types::mapping | mappings [] |
std::string http::server::mime_types::extension_to_type | ( | const std::string & | extension | ) |
Convert a file extension into a MIME type.
Definition at line 31 of file mime_types.cpp.
Referenced by http::server::request_handler::handle_request().
00032 { 00033 for (mapping* m = mappings; m->extension; ++m) 00034 { 00035 if (m->extension == extension) 00036 { 00037 return m->mime_type; 00038 } 00039 } 00040 00041 return "text/plain"; 00042 }
Referenced by extension_to_type().