From a97e18bbe941b12187637b785615f65cf7381ac0 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Tue, 19 May 2015 09:13:29 +0200 Subject: [PATCH] Shuffle some HTTP_REQUEST_NO_CONTENT_LENGTH around --- src/http.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/http.c b/src/http.c index a8f8ee9..d60266f 100644 --- a/src/http.c +++ b/src/http.c @@ -1267,11 +1267,18 @@ http_response_normal(struct http_request *req, struct connection *c, kore_buf_appendf(header_buf, "%s: %s\r\n", hdr->header, hdr->value); } - } - if (req != NULL && status != 204 && status >= 200 && - !(req->flags & HTTP_REQUEST_NO_CONTENT_LENGTH)) - kore_buf_appendf(header_buf, "content-length: %d\r\n", len); + if (status != 204 && status >= 200 && + !(req->flags & HTTP_REQUEST_NO_CONTENT_LENGTH)) { + kore_buf_appendf(header_buf, + "content-length: %d\r\n", len); + } + } else { + if (status != 204 && status >= 200) { + kore_buf_appendf(header_buf, + "content-length: %d\r\n", len); + } + } kore_buf_append(header_buf, "\r\n", 2); net_send_queue(c, header_buf->data, header_buf->offset,