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

Method http_send_static_answer

runners/BaseRunner.cpp:906–915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

904 co_return td::Unit();
905}
906void BaseRunner::http_send_static_answer(td::int32 code, std::string text,
907 std::unique_ptr<http::HttpRequestCallback> answer_callback,
908 std::string content_type) {
909 CHECK(answer_callback);
910 static const std::vector<std::pair<std::string, std::string>> headers{
911 {"Access-Control-Allow-Origin", "*"},
912 {"Access-Control-Allow-Methods", "GET, POST, OPTIONS"},
913 {"Access-Control-Allow-Headers", "Content-Type, Authorization"}};
914 answer_callback->receive_answer(code, content_type, headers, std::move(text), true);
915}
916
917void BaseRunner::http_send_static_answer(td::Result<td::BufferSlice> R,
918 std::unique_ptr<http::HttpRequestCallback> answer_callback,

Callers

nothing calls this directly

Calls 3

as_sliceMethod · 0.80
codeMethod · 0.80
receive_answerMethod · 0.45

Tested by

no test coverage detected