MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / receive_http_request_outer

Method receive_http_request_outer

runners/BaseRunner.cpp:696–720  ·  view source on GitHub ↗

* * HANDLERS * */

Source from the content-addressed store, hash-verified

694 *
695 */
696void BaseRunner::receive_http_request_outer(http::HttpCallback::RequestType request_type,
697 std::vector<std::pair<std::string, std::string>> headers, std::string path,
698 std::vector<std::pair<std::string, std::string>> args, std::string body,
699 std::unique_ptr<http::HttpRequestCallback> answer_callback) {
700 if (path == "/perf") {
701 generate_perf_stats(std::move(answer_callback)).detach();
702 return;
703 }
704
705 {
706 auto it = custom_http_handlers_.find(path);
707 if (it != custom_http_handlers_.end()) {
708 if (http_access_hash_.size() > 0 && get_from_sorted_list(args, "access_hash") != http_access_hash_) {
709 http_send_static_answer(403 /*access denied */, "", std::move(answer_callback));
710 return;
711 }
712 it->second(request_type, std::move(headers), std::move(path), std::move(args), std::move(body),
713 std::move(answer_callback));
714 return;
715 }
716 }
717
718 receive_http_request(request_type, std::move(headers), std::move(path), std::move(args), std::move(body),
719 std::move(answer_callback));
720}
721
722void BaseRunner::receive_http_request(http::HttpCallback::RequestType request_type,
723 std::vector<std::pair<std::string, std::string>> headers, std::string path,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected