MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / GetContentTypeForFilename

Function GetContentTypeForFilename

Source/SysOSX/Debug/WebDebug.cpp:207–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207static const char * GetContentTypeForFilename(const char * filename)
208{
209 const char * ext = strrchr(filename, '.');
210 if (ext)
211 {
212 if (strcmp(ext, ".js") == 0) return kApplicationJavascript;
213 if (strcmp(ext, ".css") == 0) return kTextCSS;
214 if (strcmp(ext, ".html") == 0) return kTextHTML;
215 if (strcmp(ext, ".png") == 0) return kImagePng;
216 }
217
218 DBGConsole_Msg(0, "Unknown filetype [C%s]", filename);
219 return kTextPlain;
220}
221
222static void ServeFile(WebDebugConnection * connection, const char * filename)
223{

Callers 1

ServeFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected