summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2019-11-24 00:20:14 +0100
committertomsmeding <tom.smeding@gmail.com>2019-11-24 00:20:39 +0100
commitc1d0008f6820ee51b32734597247433ccd84a259 (patch)
tree898eed27a197f02b07116e2ff6e257b3ee0642a1 /plugins
parent7a5a4bbc1742cbd2492f6e9fcdb5c4aa65396371 (diff)
static: Give error messages with a mime type
Diffstat (limited to 'plugins')
-rw-r--r--plugins/static/static.c4
1 files changed, 2 insertions, 2 deletions
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);
}