Using a proper random generator

This commit is contained in:
stephb9959
2021-11-07 08:26:11 -08:00
parent 3d8782517e
commit 2741beeef8

View File

@@ -6,6 +6,9 @@
#include "RESTObjects/RESTAPI_OWLSobjects.h"
#include "StorageService.h"
#include "Poco/Net/HTTPCookie.h"
#include "Poco/Net/NameValueCollection.h"
namespace OpenWifi {
static const std::vector<std::string> DefaultDeviceTypes{
@@ -78,8 +81,22 @@ namespace OpenWifi {
void RESTAPI_simulation_handler::DoGet() {
Poco::Net::NameValueCollection Cookies;
Request->getCookies(Cookies);
for(const auto &i:Cookies)
std::cout << "Name: " << i.first << " Value: " << i.second << std::endl;
std::vector<OWLSObjects::SimulationDetails> Sims;
StorageService()->SimulationDB().GetRecords(1,1000,Sims);
// try to add a cookie to see if it comes back.
Poco::Net::HTTPCookie Cookie("APITest", "This is a cookie");
Cookie.setMaxAge(-1);
Response->addCookie(Cookie);
ReturnObject("list", Sims);
}