mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
EnsureAcceptHeader(): fix wrong condition
This commit is contained in:
parent
8c5d629d35
commit
493a97f4f3
@ -181,7 +181,7 @@ bool EnsureAcceptHeader(
|
|||||||
{
|
{
|
||||||
namespace http = boost::beast::http;
|
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.result(http::status::bad_request);
|
||||||
response.set(http::field::content_type, "text/html");
|
response.set(http::field::content_type, "text/html");
|
||||||
response.body() = "<h1>Accept header is missing or not set to 'application/json'.</h1>";
|
response.body() = "<h1>Accept header is missing or not set to 'application/json'.</h1>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user