Skip to content

Commit

Permalink
Return the IP address of the client in ACL denied json response
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcook committed Aug 19, 2022
1 parent ce45122 commit 561bc89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/wforce-webserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void ACLFilter::doFilter(const drogon::HttpRequestPtr& req,
auto res = drogon::HttpResponse::newHttpResponse();
res->setStatusCode(drogon::k401Unauthorized);
std::stringstream ss;
ss << "{\"status\":\"failure\", \"reason\":" << "\"Source IP Address not in ACL\"" << "}";
ss << "{\"status\":\"failure\", \"reason\":" << "\"Source IP Address not in ACL\"" << ", \"ip\":\"" << peer_addr.toIp() << "\"" << "}";
res->setBody(ss.str());
res->setCloseConnection(true);
fcb(res);
Expand Down

0 comments on commit 561bc89

Please sign in to comment.