Files
UNSWebServerCore_LinuxSO/ServerProcessor.h
T
2026-06-30 17:49:51 +08:00

35 lines
913 B
C++

#pragma once
#include "Global.h"
#include "Export.h"
#include "IPTable.h"
#include "HTTPObjects.h"
class UNSWSC_DLL_EXPORT ServerProcessor
{
protected:
class Impl;
std::unique_ptr<Impl> pimpl;
public:
ServerProcessor();
virtual ~ServerProcessor();
public:
void EnableIPCheck();
void DisableIPCheck();
void UpdateBlockedIPList(IPTablePtr ips);
void AppenedBlockedIP(DateTime::Span block_time, std::string ip);
uns::HTTPMethod GetMethod(uns::RequestPtr request);
void AddStreamSettings(std::string method, bool stream);
public:
virtual uns::ResponsePtr Processor(uns::RequestPtr request) = 0;
virtual uns::PathTraversalDefenceLevel PTDefence();
virtual bool IsPathSafe(const std::string& raw_path);
public:
uns::ResponsePtr Handle(uns::RequestPtr request);
bool Stream(const std::string& method);
};
using ServerProcessorPtr = std::shared_ptr<ServerProcessor>;