void ServerHandlerImp::onRequest (HTTP::Session& session) { // Check user/password authorization auto const headers (build_map (session.message().headers)); if (! HTTPAuthorized (headers)) { session.write (HTTPReply (403, "Forbidden")); session.close (true); return; } session.detach(); m_jobQueue.addJob (jtCLIENT, "RPC-Client", std::bind ( &ServerHandlerImp::processSession, this, std::placeholders::_1, std::ref (session))); }
bool isAuthorized ( std::map <std::string, std::string> const& headers) { return HTTPAuthorized (headers); }