kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit d73a9114c0b54a5ff54ffeac0af6308745eda2c5
parent 4ab028633a5a2d512cb662198ed9ce7094a1a384
Author: Joris Vink <joris@coders.se>
Date:   Wed, 11 Apr 2018 13:04:26 +0200

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.

Diffstat:
src/http.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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);