Merge branch 'master' of bitbucket.org:LuckyLaszlo/webserv

This commit is contained in:
Hugo LAMY
2022-08-14 01:09:25 +02:00
7 changed files with 46 additions and 37 deletions

View File

@@ -88,8 +88,7 @@ void Webserv::_construct_response(Client *client)
void Webserv::_process_method(Client *client, std::string &path)
{
std::cerr << "assigned_location->path = " << client->assigned_location->path << "\n"; // debug
std::cerr << "allow_methods = " << client->assigned_location->allow_methods << "\n"; // debug
std::cerr << "allow_methods = " << http_methods_to_str(client->assigned_location->allow_methods) << "\n"; // debug
switch (client->get_rq_method())
{
@@ -185,8 +184,6 @@ ServerConfig *_determine_process_server(Client *client, std::vector<ServerConfig
// Temporary Global Scope. Probably move to Client in the future.
const LocationConfig *_determine_location(const ServerConfig &server, const std::string &path)
{
std::cout << "determin location path sent: " << path << '\n';
/* RULES ***
If a path coresponds exactly to a location, use that one
@@ -208,13 +205,8 @@ If we get a url that ends in / ignore the last /
for (std::vector<LocationConfig>::const_iterator it = server.locations.begin(); it != server.locations.end(); it++)
{
std::cout << it->path << " -- ";
if (it->path.size() > uri.size())
{
std::cout << "skipping this one\n";
continue ;
}
if (uri.compare(0, it->path.size(), it->path) == 0)
{