mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
add: cgi_pass in config file
This commit is contained in:
@@ -176,7 +176,7 @@ std::string Client::generateRespons(std::vector<ServerConfig *> &configs)
|
||||
_config = Config::getConfig(configs, _request, connected_to);
|
||||
tmp = Config::getLocation(_config->getLocations(), _request.getURI());
|
||||
_response.setData(_request, _config, tmp);
|
||||
_response.generate2();
|
||||
_response.generate2(connected_to);
|
||||
_headerToSend = _response.getHeader();
|
||||
_bodyToSend = _response.getBody();
|
||||
_toSend = _headerToSend + _bodyToSend;
|
||||
|
||||
@@ -184,6 +184,12 @@ int ServerConfig::putLocation(toml_node *node)
|
||||
return (1);
|
||||
tmp->uploadDir = *it1->second->getString();
|
||||
}
|
||||
else if (it1->first == "cgi_pass")
|
||||
{
|
||||
if (it1->second->get_type() != toml_node::STRING)
|
||||
return (1);
|
||||
tmp->cgi_pass = *it1->second->getString();
|
||||
}
|
||||
else if (it1->first == "directory_file")
|
||||
{
|
||||
if (it1->second->get_type() != toml_node::STRING)
|
||||
@@ -281,6 +287,7 @@ void ServerConfig::printFields(void)
|
||||
std::cout << YELLOW << "uploadDir " << BLUE << (*it)->uploadDir <<std::endl;
|
||||
std::cout << YELLOW << "autoindex " << BLUE << (*it)->autoindex <<std::endl;
|
||||
std::cout << YELLOW << "uploadAccept " << BLUE << (*it)->uploadAccept <<std::endl;
|
||||
std::cout << YELLOW << "cgi_pass " << BLUE << (*it)->cgi_pass <<std::endl;
|
||||
std::cout << YELLOW << "methods " << std::endl;
|
||||
it2 = (*it)->methods.begin();
|
||||
while (it2 != (*it)->methods.end())
|
||||
|
||||
@@ -14,6 +14,7 @@ struct location
|
||||
bool uploadAccept;
|
||||
std::vector<std::string> methods;
|
||||
std::map<int, std::string> redirect;
|
||||
std::string cgi_pass;
|
||||
};
|
||||
|
||||
struct serverListen
|
||||
|
||||
Reference in New Issue
Block a user