| 205 | } |
| 206 | |
| 207 | static 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 | |
| 222 | static void ServeFile(WebDebugConnection * connection, const char * filename) |
| 223 | { |