commit 9ba01725711df0396f18aab582eded36c18645a0
parent e73f1b861ba25045d5adeedb8619e39cd062526f
Author: Francesco Saccone <francesco@francescosaccone.com>
Date: Tue, 1 Apr 2025 12:57:17 +0200
fix: add final newline to text/plain response bodies
Signed-off-by: Francesco Saccone <francesco@francescosaccone.com>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
@@ -249,7 +249,7 @@ main(int argc, char *argv[]) {
if (!index_file_readable) {
response.status = NOT_FOUND;
response.content_type = "text/plain";
- response.body = "404 NOT FOUND";
+ response.body = "404 NOT FOUND\n";
} else {
struct file_content file
= get_file_content(normalised_index_path);
@@ -279,7 +279,7 @@ main(int argc, char *argv[]) {
default:
response.status = METHOD_NOT_ALLOWED;
response.content_type = "text/plain";
- response.body = "405 METHOD NOT ALLOWED";
+ response.body = "405 METHOD NOT ALLOWED\n";
send_to_socket(client_socket_fd,
compose_http_response_full(response));