From 847988f4bd9abd2c298ee8ac1d174d451b194531 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Tue, 23 May 2017 20:24:56 +0100 Subject: [PATCH] No need to prepare mustache context if no body is required. --- src/tawashi_implem/response.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tawashi_implem/response.cpp b/src/tawashi_implem/response.cpp index 61b9934..c62d421 100644 --- a/src/tawashi_implem/response.cpp +++ b/src/tawashi_implem/response.cpp @@ -205,10 +205,10 @@ namespace tawashi { HttpHeader http_header = this->on_process(); *m_stream_out << http_header; - SPDLOG_TRACE(statuslog, "Raising event on_mustache_prepare"); - this->on_mustache_prepare(mustache_context); - if (http_header.body_required()) { + SPDLOG_TRACE(statuslog, "Raising event on_mustache_prepare"); + this->on_mustache_prepare(mustache_context); + SPDLOG_TRACE(statuslog, "Rendering in mustache"); *m_stream_out << mstch::render( on_mustache_retrieve(),