mirror of https://github.com/Icinga/icinga2.git
EnsureAcceptHeader(): fix wrong condition
This commit is contained in:
parent
8c5d629d35
commit
493a97f4f3
|
@ -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>";
|
||||
|
|
Loading…
Reference in New Issue