feat: add hostname to activation info

This commit is contained in:
Mudit Vats
2021-02-12 14:42:43 -07:00
parent 9b0d7fe649
commit 025152f359

View File

@@ -77,6 +77,16 @@ web::json::value get_dns()
return web::json::value::string(tmp); return web::json::value::string(tmp);
} }
web::json::value get_hostname()
{
utility::string_t tmp;
std::string hostName = net_get_hostname();
tmp = utility::conversions::convertstring(hostName);
return web::json::value::string(tmp);
}
bool getVersion(web::json::value& value) bool getVersion(web::json::value& value)
{ {
std::string version; std::string version;
@@ -202,6 +212,9 @@ bool get_activation_payload(web::json::value& payload)
// get DNS Info // get DNS Info
activationParams[U("fqdn")] = get_dns(); activationParams[U("fqdn")] = get_dns();
// get hostname
activationParams[U("hostname")] = get_hostname();
// get client string // get client string
if (!get_client_string(value)) return false; if (!get_client_string(value)) return false;
activationParams[U("client")] = value; activationParams[U("client")] = value;
@@ -290,3 +303,4 @@ bool act_create_response(std::string payload, std::string& response)
return true; return true;
} }