From b9af380b640c8a883a244f3e0bb10f92a52936c9 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Sun, 4 Jul 2021 02:24:38 -0700 Subject: [PATCH] :racehorse: very slight improvement --- src/json_filter.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/json_filter.cpp b/src/json_filter.cpp index 25eb530..6b7b564 100644 --- a/src/json_filter.cpp +++ b/src/json_filter.cpp @@ -10,13 +10,11 @@ void JsonFilter::doFilter(const HttpRequestPtr &req, { std::string_view content_type = req->getHeader("content-type"); std::string_view accept_header = req->getHeader("Accept"); - if (content_type == "applications/json") + + if (content_type == "applications/json" && (Contains(accept_header, "*/*") || Contains(accept_header, "application/json"))) { - if (Contains(accept_header, "*/*") || Contains(accept_header, "application/json")) - { - fccb(); - return; - } + fccb(); + return; } const auto &resp = HttpResponse::newHttpJsonResponse("Client must Accept JSON");