Browse Source

return 200 instead of 404 when test is fetched

Adam Ierymenko 9 years ago
parent
commit
69b1da2e1d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      controller/SqliteNetworkController.cpp

+ 3 - 1
controller/SqliteNetworkController.cpp

@@ -1312,7 +1312,7 @@ unsigned int SqliteNetworkController::_doCPGet(
 				} else if ((path[2] == "test")&&(path.size() >= 4)) {
 
 					std::map< uint64_t,_CircuitTestEntry >::iterator cte(_circuitTests.find(Utils::hexStrToU64(path[3].c_str())));
-					if (cte != _circuitTests.end()) {
+					if ((cte != _circuitTests.end())&&(cte->second.test)) {
 
 						responseBody = "[";
 						responseBody.append(cte->second.jsonResults);
@@ -1323,6 +1323,8 @@ unsigned int SqliteNetworkController::_doCPGet(
 						::free((void *)cte->second.test);
 						_circuitTests.erase(cte);
 
+						return 200;
+
 					} // else 404
 
 				} // else 404