From 054048798664555a1c08a1a1c358468f941e27d8 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sat, 9 May 2020 18:29:45 +0200 Subject: fix empty Content-Length for HEAD --- hittpd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hittpd.c b/hittpd.c index 4ff5ebe..13306fe 100644 --- a/hittpd.c +++ b/hittpd.c @@ -279,14 +279,14 @@ send_response(http_parser *p, int status, const char *msg, char now[64]; httpdate(time(0), now); - if (p->method == HTTP_HEAD) - content = ""; - if (content) { data->first = 0; data->last = strlen(content); } + if (p->method == HTTP_HEAD) + content = ""; + int len = 0; len += snprintf(buf, sizeof buf, -- cgit 1.4.1