mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 15:55:46 +00:00
Add both Basic auth and CGI support
This commit is contained in:
23
include/TessesFramework/Http/CGIServer.hpp
Normal file
23
include/TessesFramework/Http/CGIServer.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
#include "../Filesystem/VFS.hpp"
|
||||
#include "../Filesystem/VFSFix.hpp"
|
||||
#include "HttpServer.hpp"
|
||||
#include <optional>
|
||||
namespace Tesses::Framework::Http {
|
||||
struct CGIParams {
|
||||
std::optional<Tesses::Framework::Filesystem::VFSPath> document_root;
|
||||
Tesses::Framework::Filesystem::VFSPath program;
|
||||
std::optional<std::string> adminEmail;
|
||||
std::optional<Tesses::Framework::Filesystem::VFSPath> workingDirectory;
|
||||
};
|
||||
class CGIServer : public Tesses::Framework::Http::IHttpServer {
|
||||
Tesses::Framework::Filesystem::VFSPath dir;
|
||||
public:
|
||||
std::optional<Tesses::Framework::Filesystem::VFSPath> document_root;
|
||||
std::optional<std::string> adminEmail;
|
||||
std::optional<Tesses::Framework::Filesystem::VFSPath> workingDirectory;
|
||||
CGIServer(Tesses::Framework::Filesystem::VFSPath dir);
|
||||
bool Handle(ServerContext& ctx);
|
||||
static bool ServeCGIRequest(ServerContext& ctx, CGIParams& params);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user