🐎 very slight improvement

This commit is contained in:
EntireTwix 2021-07-04 02:24:38 -07:00
parent 6402ad300c
commit b9af380b64

View file

@ -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");