From: Alexander A. Klimov Date: Fri, 15 Feb 2019 14:24:02 +0000 (+0100) Subject: EnsureAcceptHeader(): fix wrong condition X-Git-Tag: v2.11.0-rc1~174^2~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=493a97f4f3caa43d1c86c4d6b0f67602fd1b7185;p=icinga2 EnsureAcceptHeader(): fix wrong condition --- diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp index 7ea206f5f..a37b3a0b1 100644 --- a/lib/remote/httpserverconnection.cpp +++ b/lib/remote/httpserverconnection.cpp @@ -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() = "

Accept header is missing or not set to 'application/json'.

";