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

+2 -1
View File
@@ -78,8 +78,9 @@ static char *mg_ssi(const char *path, const char *root, int depth) {
void mg_http_serve_ssi(struct mg_connection *c, const char *root,
const char *fullpath) {
const char *headers = "Content-Type: text/html; charset=utf-8\r\n";
char *data = mg_ssi(fullpath, root, 0);
mg_http_reply(c, 200, "", "%s", data == NULL ? "" : data);
mg_http_reply(c, 200, headers, "%s", data == NULL ? "" : data);
free(data);
}
#endif
+1
View File
@@ -1,3 +1,4 @@
#ifndef MONGOOSE_H
#define MONGOOSE_H