#pragma once #include "../Filesystem/VFS.hpp" #include "../Filesystem/VFSFix.hpp" #include "HttpServer.hpp" #include namespace Tesses::Framework::Http { struct CGIParams { std::optional document_root; Tesses::Framework::Filesystem::VFSPath program; std::optional adminEmail; std::optional workingDirectory; }; class CGIServer : public Tesses::Framework::Http::IHttpServer { Tesses::Framework::Filesystem::VFSPath dir; public: std::optional document_root; std::optional adminEmail; std::optional workingDirectory; CGIServer(Tesses::Framework::Filesystem::VFSPath dir); bool Handle(ServerContext& ctx); static bool ServeCGIRequest(ServerContext& ctx, CGIParams& params); }; }