hermes

HTTP GET/HEAD-only web server for static content.
git clone git://git.francescosaccone.com/hermes
Log | Files | Refs | README | LICENSE

commit 6074d769164448a53cc02fd069fa2b1112e98500
parent 11dd79896aceb6cb021e4892f766f99c3758ca34
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:
Mmain.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c @@ -248,7 +248,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); @@ -278,7 +278,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));