From e7e25cade5bc31a8637292aaa877da8a81deb6e2 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 14 Dec 2022 15:02:10 +0000 Subject: [PATCH] Fix an instance of setting response headers after they were sent. --- src/Matrix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Matrix.c b/src/Matrix.c index c49795c..ea71a60 100644 --- a/src/Matrix.c +++ b/src/Matrix.c @@ -125,15 +125,15 @@ MatrixHttpHandler(HttpServerContext * context, void *argp) Free(pathPart); - HttpSendHeaders(context); - if (!response) { - Log(lc, LOG_WARNING, "A route handler returned NULL."); + Log(lc, LOG_ERR, "A route handler returned NULL."); HttpResponseStatus(context, HTTP_INTERNAL_SERVER_ERROR); response = MatrixErrorCreate(M_UNKNOWN); } + HttpSendHeaders(context); + stream = HttpStream(context); JsonEncode(response, stream); fprintf(stream, "\n");