Skip to content

Commit 1d5ee57

Browse files
committed
MIME types
1 parent fa4656c commit 1d5ee57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

httpd.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,28 @@ int httpd::req_handler(void * cls,
8080

8181
rsp = MHD_create_response_from_buffer(sHtmlCssSize, (void*)sHtmlCssFile, MHD_RESPMEM_PERSISTENT);
8282
MHD_add_response_header(rsp, "ETag", sHtmlCssEtag);
83+
MHD_add_response_header(rsp, "Content-Type", "text/css; charset=utf-8");
8384
}
8485
else if(strcasecmp(url, "/h") == 0 || strcasecmp(url, "/hashrate") == 0)
8586
{
8687
executor::inst()->get_http_report(EV_HTML_HASHRATE, str);
8788

8889
rsp = MHD_create_response_from_buffer(str.size(), (void*)str.c_str(), MHD_RESPMEM_MUST_COPY);
90+
MHD_add_response_header(rsp, "Content-Type", "text/html; charset=utf-8");
8991
}
9092
else if(strcasecmp(url, "/c") == 0 || strcasecmp(url, "/connection") == 0)
9193
{
9294
executor::inst()->get_http_report(EV_HTML_CONNSTAT, str);
9395

9496
rsp = MHD_create_response_from_buffer(str.size(), (void*)str.c_str(), MHD_RESPMEM_MUST_COPY);
97+
MHD_add_response_header(rsp, "Content-Type", "text/html; charset=utf-8");
9598
}
9699
else if(strcasecmp(url, "/r") == 0 || strcasecmp(url, "/results") == 0)
97100
{
98101
executor::inst()->get_http_report(EV_HTML_RESULTS, str);
99102

100103
rsp = MHD_create_response_from_buffer(str.size(), (void*)str.c_str(), MHD_RESPMEM_MUST_COPY);
104+
MHD_add_response_header(rsp, "Content-Type", "text/html; charset=utf-8");
101105
}
102106
else
103107
{

0 commit comments

Comments
 (0)