EnsureAcceptHeader(): fix wrong condition

This commit is contained in:
Alexander A. Klimov 2019-02-15 15:24:02 +01:00
parent 8c5d629d35
commit 493a97f4f3
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ bool EnsureAcceptHeader(
{
namespace http = boost::beast::http;
if (request.method() == http::verb::get && request[http::field::accept] != "application/json") {
if (request.method() != http::verb::get && request[http::field::accept] != "application/json") {
response.result(http::status::bad_request);
response.set(http::field::content_type, "text/html");
response.body() = "<h1>Accept header is missing or not set to 'application/json'.</h1>";