Skip to content

Commit

Permalink
Fix ovpncli fake response to be correctly formatted JSON message
Browse files Browse the repository at this point in the history
Signed-off-by: Arne Schwabe <arne@openvpn.net>
  • Loading branch information
schwabe authored and Jenkins-dev committed Jan 31, 2025
1 parent f206876 commit 6f1f0bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/ovpncli/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,14 @@ class Client : public ClientBase
}
else if (string::starts_with(acev.payload, "{\"dpc_request\"") && acev.payload.find("client_info") != std::string::npos)
{
std::string fakeResponse{R"("dpc_response\": {

std::string fakeResponse{R"({"dpc_response": {
"client_info" : {
"os" : {"type" : "FakeOS", "version" : "1.2.3.4" }
"os" : {"type" : "Windows", "version" : "10.0.19045" }
}
})"};
}})"};

std::cout << "ACC DPC1: sending fake client info:" << fakeResponse << std::endl;
send_app_control_channel_msg("dpc1", fakeResponse);
}
else if (string::starts_with(acev.payload, "{\"dpc_request\""))
Expand Down

0 comments on commit 6f1f0bf

Please sign in to comment.