jfjoch_broker: Fix HTTP sending two responses at error
This commit is contained in:
@@ -108,12 +108,12 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
if(!output.validate(s)) {
|
||||
logger.Error(s.str());
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, s.str(), MIME(Text, Plain));
|
||||
} else {
|
||||
nlohmann::json j = output;
|
||||
if (compression)
|
||||
response.setCompression(Pistache::Http::Header::Encoding::Deflate);
|
||||
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
|
||||
}
|
||||
|
||||
nlohmann::json j = output;
|
||||
if (compression)
|
||||
response.setCompression(Pistache::Http::Header::Encoding::Deflate);
|
||||
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
|
||||
}
|
||||
|
||||
void version_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
Reference in New Issue
Block a user