5 // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef HTTP_SERVER2_REQUEST_HANDLER_HPP
12 #define HTTP_SERVER2_REQUEST_HANDLER_HPP
15 #include <boost/noncopyable.hpp>
23 /// The common handler for all incoming requests.
25 : private boost::noncopyable
28 /// Construct with a directory containing files to be served.
29 explicit request_handler(const std::string& doc_root);
31 /// Handle a request and produce a reply.
32 void handle_request(const request& req, reply& rep);
35 /// The directory containing the files to be served.
36 std::string doc_root_;
38 /// Perform URL-decoding on a string. Returns false if the encoding was
40 static bool url_decode(const std::string& in, std::string& out);
43 } // namespace server2
46 #endif // HTTP_SERVER2_REQUEST_HANDLER_HPP