Add initial webserver sources

This commit is contained in:
2022-06-30 01:35:02 +02:00
parent 2721be2d22
commit 7b93dfa6cf
26 changed files with 1018 additions and 0 deletions
@@ -0,0 +1,36 @@
#pragma once
// system includes
#include <string_view>
#include <string>
#include <utility>
#include <vector>
#include <system_error>
// 3rdparty lib includes
#include <asio_webserver/responsehandler.h>
// forward declarations
class ClientConnection;
class DebugResponseHandler : public ResponseHandler
{
public:
DebugResponseHandler(ClientConnection &clientConnection, std::string_view method, std::string_view path, std::string_view protocol);
~DebugResponseHandler() override;
void requestHeaderReceived(std::string_view key, std::string_view value) final;
void sendResponse() final;
private:
void written(std::error_code ec, std::size_t length);
ClientConnection &m_clientConnection;
std::string m_method;
std::string m_path;
std::string m_protocol;
std::vector<std::pair<std::string, std::string>> m_requestHeaders;
std::string m_response;
};