We expect the id to be passed as one parameter. Eg: 'query_id' or 'session_id'. Returns true if the id was present and valid; false otherwise.
| 83 | // We expect the id to be passed as one parameter. Eg: 'query_id' or 'session_id'. |
| 84 | // Returns true if the id was present and valid; false otherwise. |
| 85 | static Status ParseIdFromRequest(const Webserver::WebRequest& req, TUniqueId* id, |
| 86 | const std::string &to_find) { |
| 87 | const auto& args = req.parsed_args; |
| 88 | Webserver::ArgumentMap::const_iterator it = args.find(to_find); |
| 89 | if (it == args.end()) { |
| 90 | return Status(Substitute("No '$0' argument found.", to_find)); |
| 91 | } else { |
| 92 | if (ParseId(it->second, id)) return Status::OK(); |
| 93 | return Status(Substitute("Could not parse '$0' argument: $1", to_find, it->second)); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | } |
| 98 |
no test coverage detected