mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 13:27:59 +03:00
add: config support in client and Response class
This commit is contained in:
@@ -12,15 +12,43 @@ private:
|
||||
std::string _header;
|
||||
Request _request;
|
||||
ServerConfig *_config;
|
||||
location *_location;
|
||||
int _code;
|
||||
private:
|
||||
std::map<int, std::string> _errorPages;
|
||||
bool _Autoindex;
|
||||
serverListen _hostPort;
|
||||
std::string _fullURI;
|
||||
std::string _method;
|
||||
|
||||
private:
|
||||
std::string _contentType;
|
||||
unsigned int _contentLength;
|
||||
std::string _server;
|
||||
std::string _keepAlive;
|
||||
std::string _date;
|
||||
std::string _cacheControl;
|
||||
std::string _locationSTR;
|
||||
std::string _contentLanguage;
|
||||
std::string _transferEncoding;
|
||||
|
||||
void setHeaderBlocks(void);
|
||||
void setContentType(void);
|
||||
void setContentLength(void);
|
||||
void setServer(void);
|
||||
void setConnection(void);
|
||||
void setDate(void);
|
||||
void setCacheControl(void);
|
||||
void setLocation(void);
|
||||
void setLanguage(void);
|
||||
void setTransferEncoding(void);
|
||||
private:
|
||||
static std::map<std::string, std::string> _errorCode;
|
||||
|
||||
private:
|
||||
void methodGet(void);
|
||||
// void methodPost(void);
|
||||
// void methodDelete(void);
|
||||
void methodPost(void);
|
||||
void methodDelete(void);
|
||||
void invalidClient(void);
|
||||
void generateHeader(void);
|
||||
void generateBody(void);
|
||||
@@ -32,13 +60,16 @@ public:
|
||||
static std::string getReasonPhrase(std::string);
|
||||
static std::string getReasonPhrase(int);
|
||||
std::string getErrorPage(int code);
|
||||
std::string getFullURI(std::string &, std::string &);
|
||||
|
||||
|
||||
void setData(Request, ServerConfig *);
|
||||
void setData(Request &, ServerConfig *, location *location);
|
||||
public:
|
||||
void OpenResponseFile(const char *path);
|
||||
void initErrorCode(void);
|
||||
void generate();
|
||||
void generate2();
|
||||
Response();
|
||||
~Response();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user