MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/xstudio / dispatch_request

Method dispatch_request

extern/include/cpp-httplib/httplib.h:5641–5653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5639}
5640
5641inline bool Server::dispatch_request(Request &req, Response &res,
5642 const Handlers &handlers) {
5643 for (const auto &x : handlers) {
5644 const auto &pattern = x.first;
5645 const auto &handler = x.second;
5646
5647 if (std::regex_match(req.path, req.matches, pattern)) {
5648 handler(req, res);
5649 return true;
5650 }
5651 }
5652 return false;
5653}
5654
5655inline void Server::apply_ranges(const Request &req, Response &res,
5656 std::string &content_type,

Callers

nothing calls this directly

Calls 1

handlerFunction · 0.85

Tested by

no test coverage detected