mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-19 01:22:14 +11:00
🐎 very slight improvement
This commit is contained in:
parent
6402ad300c
commit
b9af380b64
1 changed files with 4 additions and 6 deletions
|
|
@ -10,14 +10,12 @@ void JsonFilter::doFilter(const HttpRequestPtr &req,
|
||||||
{
|
{
|
||||||
std::string_view content_type = req->getHeader("content-type");
|
std::string_view content_type = req->getHeader("content-type");
|
||||||
std::string_view accept_header = req->getHeader("Accept");
|
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();
|
fccb();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const auto &resp = HttpResponse::newHttpJsonResponse("Client must Accept JSON");
|
const auto &resp = HttpResponse::newHttpJsonResponse("Client must Accept JSON");
|
||||||
resp->setStatusCode(k406NotAcceptable);
|
resp->setStatusCode(k406NotAcceptable);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue