Handle more mime types

This commit is contained in:
cpq committed 2020-12-15 11:58:30 +00:00
1 parent fa8f62fb5d
commit f176e1ae59
4 files changed
+126 -8

No files matched your search

View File
Whitespace-only changes.
+10
View File
@@ -484,6 +484,16 @@ static void test_http_server(void) {
free(data);
}
{
// Test mime type
struct mg_http_message hm;
ASSERT(fetch(&mgr, buf, url, "GET /empty.js HTTP/1.0\r\n\n") == 200);
mg_http_parse(buf, strlen(buf), &hm);
ASSERT(mg_http_get_header(&hm, "Content-Type") != NULL);
ASSERT(mg_strcmp(*mg_http_get_header(&hm, "Content-Type"),
mg_str("text/javascript")) == 0);
}
{
// Test connection refused
int i, errored = 0;