Add Content-Type header to the SSI files

This commit is contained in:
Sergey Lyubka committed 2021-07-20 11:33:38 +01:00
1 parent 3982e065c8
commit 655f9a9f79
5 files changed
+14 -2

No files matched your search

+8
View File
@@ -507,6 +507,14 @@ static void test_http_server(void) {
"recurse\n\n"
"recurse\n\n"
"recurse\n\n") == 0);
{
struct mg_http_message hm;
mg_http_parse(buf, strlen(buf), &hm);
ASSERT(mg_http_get_header(&hm, "Content-Length") != NULL);
ASSERT(mg_http_get_header(&hm, "Content-Type") != NULL);
ASSERT(mg_strcmp(*mg_http_get_header(&hm, "Content-Type"),
mg_str("text/html; charset=utf-8")) == 0);
}
ASSERT(fetch(&mgr, buf, url, "GET /badroot HTTP/1.0\r\n\n") == 400);
#if MG_ARCH == MG_ARCH_WIN32