diff options
Diffstat (limited to 'http/parsing.hpp')
-rw-r--r-- | http/parsing.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/http/parsing.hpp b/http/parsing.hpp index cf813537ed..d59621104c 100644 --- a/http/parsing.hpp +++ b/http/parsing.hpp @@ -32,9 +32,10 @@ inline JsonParseResult parseRequestAsJson(const crow::Request& req, req.getHeaderValue(boost::beast::http::field::content_type))) { BMCWEB_LOG_WARNING("Failed to parse content type on request"); -#ifndef BMCWEB_INSECURE_IGNORE_CONTENT_TYPE - return JsonParseResult::BadContentType; -#endif + if constexpr (!BMCWEB_INSECURE_IGNORE_CONTENT_TYPE) + { + return JsonParseResult::BadContentType; + } } jsonOut = nlohmann::json::parse(req.body(), nullptr, false); if (jsonOut.is_discarded()) |