From c1d0008f6820ee51b32734597247433ccd84a259 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 24 Nov 2019 00:20:14 +0100 Subject: static: Give error messages with a mime type --- plugins/static/static.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/static') diff --git a/plugins/static/static.c b/plugins/static/static.c index 61cd259..5152068 100644 --- a/plugins/static/static.c +++ b/plugins/static/static.c @@ -76,14 +76,14 @@ static struct buffer build_response_headers(const char *status, const char *cont static void send_404(int sock) { const char *body = "404 Not found"; - struct buffer buffer = build_response_headers("404 Not found", NULL, strlen(body)); + struct buffer buffer = build_response_headers("404 Not found", "text/plain", strlen(body)); buffer_append_str(&buffer, body); sendall(sock, buffer.buf, buffer.len); } static void send_500(int sock) { const char *body = "500 Internal server error"; - struct buffer buffer = build_response_headers("500 Internal server error", NULL, strlen(body)); + struct buffer buffer = build_response_headers("500 Internal server error", "text/plain", strlen(body)); buffer_append_str(&buffer, body); sendall(sock, buffer.buf, buffer.len); } -- cgit v1.2.3-70-g09d2