MCPcopy Create free account
hub / github.com/Icinga/icinga2 / HandleRequest

Method HandleRequest

test/remote-httpserverconnection.cpp:76–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75private:
76 bool HandleRequest(const WaitGroup::Ptr&, const HttpApiRequest& request, HttpApiResponse& response,
77 boost::asio::yield_context& yc) override
78 {
79 response.result(boost::beast::http::status::ok);
80
81 auto path = request.Url()->GetPath();
82
83 if (path.size() == 3) {
84 if (auto it = testFns.find(path[2].GetData()); it != testFns.end()) {
85 it->second(response, yc);
86 return true;
87 }
88 }
89
90 response.body() << "test";
91 return true;
92 }
93
94 static inline std::unordered_map<std::string, TestFn> testFns;
95};

Callers

nothing calls this directly

Calls 5

findMethod · 0.80
GetPathMethod · 0.45
UrlMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected