]> granicus.if.org Git - icinga2/commitdiff
EnsureAcceptHeader(): fix wrong condition
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Fri, 15 Feb 2019 14:24:02 +0000 (15:24 +0100)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Mon, 1 Apr 2019 09:40:14 +0000 (11:40 +0200)
lib/remote/httpserverconnection.cpp

index 7ea206f5ffae60242bae0c0cf04d5284d8505568..a37b3a0b14c2543c3076d93bdc05db5174dbbd30 100644 (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>";