From d73a9114c0b54a5ff54ffeac0af6308745eda2c5 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Wed, 11 Apr 2018 13:04:26 +0200 Subject: [PATCH] Improve http_response() for server side errors. In case http_response() is called with an error code indicating a server side error (>= 500) do not append any headers set by the caller. --- src/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http.c b/src/http.c index 3b86562..7c7f6cd 100644 --- a/src/http.c +++ b/src/http.c @@ -1664,7 +1664,7 @@ http_response_normal(struct http_request *req, struct connection *c, http_hsts_enable); } - if (req != NULL) { + if (req != NULL && req->status < HTTP_STATUS_INTERNAL_ERROR) { TAILQ_FOREACH(ck, &(req->resp_cookies), list) http_write_response_cookie(ck);