You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#pragma once
|
|
|
|
#include "webserv.hpp"
|
|
|
|
|
|
|
|
class Route {
|
|
|
|
protected:
|
|
|
|
Server *_server;
|
|
|
|
string _location;
|
|
|
|
string _root;
|
|
|
|
string _ret;
|
|
|
|
bool _autoindex;
|
|
|
|
|
|
|
|
public:
|
|
|
|
std::vector<string> _indexs;
|
|
|
|
std::vector<string> _headers;
|
|
|
|
std::map<string, string> _cgi;
|
|
|
|
|
|
|
|
Route(Server *server, string location, JSONNode *datas);
|
|
|
|
~Route(void);
|
|
|
|
string getLocation(void);
|
|
|
|
string getRoot(void);
|
|
|
|
string getReturn(void);
|
|
|
|
std::vector<string> getIndexsLst(void);
|
|
|
|
std::vector<string> getHeadersLst(void);
|
|
|
|
Server *getServer(void);
|
|
|
|
string getIndex(string uri, string path);
|
|
|
|
string correctUri(string uri);
|
|
|
|
friend class Socket;
|
|
|
|
};
|