| 6309 | } |
| 6310 | |
| 6311 | inline bool Server::dispatch_request(Request &req, Response &res, |
| 6312 | const Handlers &handlers) { |
| 6313 | for (const auto &x : handlers) { |
| 6314 | const auto &matcher = x.first; |
| 6315 | const auto &handler = x.second; |
| 6316 | |
| 6317 | if (matcher->match(req)) { |
| 6318 | handler(req, res); |
| 6319 | return true; |
| 6320 | } |
| 6321 | } |
| 6322 | return false; |
| 6323 | } |
| 6324 | |
| 6325 | inline void Server::apply_ranges(const Request &req, Response &res, |
| 6326 | std::string &content_type, |