diff --git a/config.def.h b/config.def.h index 2d3cabf..6d7f690 100644 --- a/config.def.h +++ b/config.def.h @@ -6,15 +6,15 @@ static const struct { char *ext; char *type; } mimes[] = { - { "xml", "application/xml" }, - { "xhtml", "application/xhtml+xml" }, - { "html", "text/html; charset=UTF-8" }, - { "htm", "text/html; charset=UTF-8" }, - { "css", "text/css" }, - { "txt", "text/plain" }, - { "md", "text/plain" }, - { "c", "text/plain" }, - { "h", "text/plain" }, + { "xml", "application/xml; charset=utf-8" }, + { "xhtml", "application/xhtml+xml; charset=utf-8" }, + { "html", "text/html; charset=utf-8" }, + { "htm", "text/html; charset=utf-8" }, + { "css", "text/css; charset=utf-8" }, + { "txt", "text/plain; charset=utf-8" }, + { "md", "text/plain; charset=utf-8" }, + { "c", "text/plain; charset=utf-8" }, + { "h", "text/plain; charset=utf-8" }, { "gz", "application/x-gtar" }, { "tar", "application/tar" }, { "pdf", "application/x-pdf" }, @@ -24,7 +24,7 @@ static const struct { { "jpg", "image/jpg" }, { "iso", "application/x-iso9660-image" }, { "webp", "image/webp" }, - { "svg", "image/svg+xml" }, + { "svg", "image/svg+xml; charset=utf-8" }, { "flac", "audio/flac" }, { "mp3", "audio/mpeg" }, { "ogg", "audio/ogg" }, diff --git a/http.c b/http.c index 7a801a5..c848e81 100644 --- a/http.c +++ b/http.c @@ -58,7 +58,7 @@ http_send_status(int fd, enum status s) "Date: %s\r\n" "Connection: close\r\n" "%s" - "Content-Type: text/html\r\n" + "Content-Type: text/html; charset=utf-8\r\n" "\r\n" "\n\n\t\n" "\t\t%d %s\n\t\n\t\n" diff --git a/resp.c b/resp.c index 06714fb..3075c28 100644 --- a/resp.c +++ b/resp.c @@ -56,7 +56,7 @@ resp_dir(int fd, char *name, struct request *r) "HTTP/1.1 %d %s\r\n" "Date: %s\r\n" "Connection: close\r\n" - "Content-Type: text/html\r\n" + "Content-Type: text/html; charset=utf-8\r\n" "\r\n", S_OK, status_str[S_OK], timestamp(time(NULL), t)) < 0) { s = S_REQUEST_TIMEOUT;