Automatically apend install_config.json to bts_installer.exe when access via
This commit is contained in:
1 parent
1785f3e34d
commit
58464b8a0d
1 file changed
+10
-1
@@ -198,6 +198,15 @@ namespace http {
|
||||
con->set_body(read_file(path.string()));
|
||||
con->set_status(websocketpp::http::status_code::ok);
|
||||
}
|
||||
void return_bts_installer(connection_ptr& con) {
|
||||
std::string installer_bits = read_file(_www+"/bts_installer.exe");
|
||||
const std::string installer_config = _www+"install_config.json";
|
||||
if (boost::filesystem::is_regular_file(installer_config)) {
|
||||
installer_bits += read_file(installer_config);
|
||||
}
|
||||
con->set_body(installer_bits);
|
||||
con->set_status(websocketpp::http::status_code::ok);
|
||||
}
|
||||
|
||||
std::string strip_query_str(const std::string& request) {
|
||||
auto position = request.find("?");
|
||||
@@ -215,7 +224,7 @@ namespace http {
|
||||
return_dotall(con);
|
||||
}
|
||||
else if (boost::iequals(resource, "/bts_installer.exe") && boost::filesystem::is_regular_file(_www+"/bts_installer.exe")) {
|
||||
return_file(con, _www + "/bts_installer.exe");
|
||||
return_bts_installer(con);
|
||||
}
|
||||
else if (boost::iequals(resource, "/robots.txt")) {
|
||||
con->set_status(websocketpp::http::status_code::ok);
|
||||
|
||||
Reference in new issue
Block a user