From a54cdaa8412bae6870bc374f3b9954b044d382c0 Mon Sep 17 00:00:00 2001 From: Quinten Date: Thu, 25 Sep 2025 11:26:55 +0200 Subject: [PATCH] feat(validation): just an outline --- webserv/http/RequestValidator.hpp | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 webserv/http/RequestValidator.hpp diff --git a/webserv/http/RequestValidator.hpp b/webserv/http/RequestValidator.hpp new file mode 100644 index 0000000..4ec1249 --- /dev/null +++ b/webserv/http/RequestValidator.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include +#include + +#include +#include + +class RequestValidator +{ + public: + struct ValidationError + { + int statusCode; + std::string message; + }; + + RequestValidator() = delete; + RequestValidator(const ServerConfig &config, const HttpRequest &request); + RequestValidator(const RequestValidator &other) = delete; + RequestValidator(RequestValidator &&other) = delete; + + RequestValidator &operator=(const RequestValidator &other) = delete; + RequestValidator &operator=(RequestValidator &&other) = delete; + + ~RequestValidator() = default; + + [[nodiscard]] std::optional validate() const; + + private: + ServerConfig &config; + HttpRequest &request; +}; \ No newline at end of file