Skip to content

Commit

Permalink
handle http-status 0 is sometimes success
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperlarson committed Sep 2, 2024
1 parent c70a403 commit f9db01b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/forti_api/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ class FortiAPI {

static Response validate(const std::string &method, const std::string &path, const nlohmann::json &data = {}) {
auto response = request<Response>(method, path, data);
if (response.http_status != 200) std::cerr << "Post response: { http_status " << response.http_status
<< ", status: " << response.status << " }" << std::endl;
if (response.status != "success") std::cerr << "Post response: { http_status " << response.http_status
<< ", status: " << response.status << " }" << std::endl;
return response;
}

Expand Down

0 comments on commit f9db01b

Please sign in to comment.